docs(docs): trial step 19 tool and the tapped tool's focus, pinned
This commit is contained in:
1 parent
b0344a4af6
commit
448a17eff7
3 files changed
+21
-6
No files matched your search
@@ -614,12 +614,13 @@ function focusedUnderStrip(page: Page) {
|
||||
return page.evaluate(() => {
|
||||
const active = document.activeElement as HTMLElement
|
||||
const strip = document.querySelector('[data-testid="edit-strip"]')!
|
||||
const label = active.getAttribute('aria-label') ?? active.textContent ?? ''
|
||||
const inPlace =
|
||||
!!active.closest('[data-place="annotations.drawing"]') &&
|
||||
!strip.contains(active)
|
||||
return {
|
||||
inPlace,
|
||||
name: `${active.tagName} « ${(active.getAttribute('aria-label') ?? active.textContent ?? '').trim().slice(0, 30)} »`,
|
||||
name: `${active.tagName} « ${label.trim().slice(0, 30)} »`,
|
||||
top: active.getBoundingClientRect().top,
|
||||
stripBottom: strip.getBoundingClientRect().bottom,
|
||||
}
|
||||
|
||||
@@ -232,6 +232,20 @@ describe('placing and the form (A4, A5)', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('Safari: a tracing started by a tap (no focus move)', () => {
|
||||
it('the tapped « Zone » takes the focus off body and keeps it through the first vertex', async () => {
|
||||
await mount()
|
||||
act(() => (document.activeElement as HTMLElement | null)?.blur())
|
||||
const zone = screen.getByRole('button', { name: 'Zone' })
|
||||
fireEvent.click(zone)
|
||||
expect(document.activeElement).toBe(zone)
|
||||
pressAt(canvas(), 20, 20)
|
||||
expect(screen.getByTestId('tracing-commands')).toBeInTheDocument()
|
||||
// As after a keyboard press of « Zone »: the tracing's commands do not take it.
|
||||
expect(document.activeElement).toBe(zone)
|
||||
})
|
||||
})
|
||||
|
||||
describe('« Reprendre le tracé » edits the closed shape with its handles (board 04 C)', () => {
|
||||
const SQUARE: Point[] = [
|
||||
[20, 20],
|
||||
|
||||
Reference in new issue
Block a user