fix(editor): any pointer press clears the keyboard scroll of a vertex

The key flag only heard presses on the handle group: a press on the
interior after a keyed series let the re-chosen vertex scroll the page
under the pointer. Any pointerdown in the document now clears it.
This commit is contained in:
bchanot committed 2026-11-19 15:18:04 +01:00
1 parent 462a22e74f
commit 303e153777
2 files changed
+19 -10

No files matched your search

@@ -1326,9 +1326,15 @@ describe('Safari: the focus after a press that commits a pending series', () =>
it('a press on the interior keeps the focus on the handle that held the series', async () => {
await keyedVertex()
const seen = watchCommitFocus()
// A pointer path never scrolls the page under the pointer, even after keys (rev 4 M-1).
const scrolls = vi
.spyOn(window.Element.prototype, 'scrollIntoView')
.mockImplementation(() => undefined)
pressAt(marker('z'), 50, 50)
expect(seen[0]).toBe(vertex(1))
expect(document.activeElement).toBe(vertex(1))
expect(scrolls).not.toHaveBeenCalled()
scrolls.mockRestore()
})
it('a press on « + » commits with the focus kept', async () => {