Repository navigation
Conversation
…press With a page veil, a field updating on change and a button next to it, a click on the button right after typing into the field was lost. Pressing the button takes the focus from the field, which fires its change event within the mousedown; the channel is free, so the request is sent at once and the veil is appended before the mouse button comes up. The mouseup lands on the veil, and the browser clicks the nearest common ancestor of the mousedown and mouseup targets, the body, not the button. The field was saved and the button did nothing, whenever the field's round trip outlasted the press. A tap on a touch screen loses its click the same way: the compatibility mousedown that moves the focus comes after the pointerup. Wicket.Veil now remembers the element of a mousedown that does not land on a veil. When the matching mouseup lands on a veil, it works out the element the browser would have clicked without the veil, the common ancestor of the pressed element and the element under the veil at the release point, and clicks it once the veil is lowered and no other veil covers it. Nothing is replayed when that ancestor holds the veil, because the browser's own click reached it, as for a press dragged off the button onto the page. The replay is skipped when the element is hidden or disabled by then, or when a new press started outside the veil meanwhile; a press on the veil leaves it pending. If the response replaced the element, the click goes to the element now carrying its id, or that of its closest ancestor with an id that does not hold the veil. The issue proposed pointerdown and pointerup. The mouse events are used instead because with touch the change event, and so the veil, comes after the pointerup, which then never lands on the veil; the compatibility mouse events see the lost click for the mouse and for touch alike. An application sees the click it lost before: the button's handlers run once the veil is lowered, through HTMLElement.click(), so the replayed event is not trusted and carries no coordinates. VeilPage gets a field updating on change next to a Save button, and VeilPageSeleniumTest clicks Save with a real mouse and taps it with a real touch right after typing, and drags a press off Save onto the field. GitHub issue #1944
papegaaij
reviewed
Nov 23, 2026
papegaaij
left a comment
Contributor
There was a problem hiding this comment.
The replay approach makes sense to me, but I found a few problems with when and how the click is replayed, plus some test gaps. Details inline.
Missing tests: no QUnit test covers a stale press (see the onMouseDown comment), a click with a modifier key held, or a replay onto an ancestor below body or the host.
# Conflicts: # wicket-extensions/src/test/js/veil-test.js
…ly once Review of the click replay of Wicket.Veil found these problems: - A press on the veil returned early without forgetting the press before it, and only a left mouseup forgot it. When the mouseup of a press never came, as for a link dragged away, which fires dragstart and dragend but no mouseup, a later click on a veil raised by a request the mouse did not start was replayed on that element once the veil was lowered. A press on the veil and a dragstart now forget the press, and a pending replay stays in place. - The browser still sends its own click to the common ancestor of the pressed element and the veil: the host of a local veil, the body for the page veil. A delegated click handler on a veiled row ran once for that click and once more for the replay, and an Ajax click behaviour on the host sent two requests. When a replay is recorded, the click that comes with the release is dropped now if its target holds the veil; a click in a later task is left alone. Each press makes one click, the replayed one. - HTMLElement.click() sends a click without ctrlKey, metaKey, shiftKey or altKey, so a Ctrl- or Cmd-click on a link released on the veil navigated the current tab, and a Shift-click lost its Shift. A release with a modifier held is no longer replayed, which leaves it as lost as it was without the replay. - A mouse event sent to the document or to a text node threw a TypeError in the window listeners; those targets are ignored now. New QUnit tests cover a press whose release never came, a dragged element, the modifiers, the browser's click on the host and on the body, a replay onto an ancestor below the body, and mouse events sent to the document or a text node. VeilPageSeleniumTest records the clicks that reach the window: a click or tap released on the veil makes one click, on Save, and a press dragged off Save onto the field one click, on their form. That test was named as if nothing were replayed for it, and is renamed. An application no longer gets the browser's click on the veiled host or the body next to a replayed click, and gets no click for a release with a modifier held. GitHub issue #1944
Contributor
Author
|
Thanks for the review. cdf7eba addresses the inline comments, and the missing tests are in |
papegaaij
approved these changes
Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1944
Stacked on #1995 (GitHub issue #1943). Its base is
veil-keyboard-1943, so the diff shows only this fix. Merge #1995 first; GitHub then retargets this PR tomaster.With a page veil, a field updating on
changeand a button next to it, a click on the button right after typing into the field was lost. Pressing the button takes the focus from the field, which fires itschangewithin themousedown; the channel is free, so the request is sent at once and the veil is appended before the mouse button comes up. Themouseuplands on the veil, and the browser clicks the nearest common ancestor of themousedownandmouseuptargets,body, not the button. The field was saved and the button did nothing, whenever the field's round trip outlasted the press. A tap on a touch screen loses its click the same way.What it does now
Wicket.Veilremembers the element of amousedownthat does not land on a veil. When the matchingmouseuplands on a veil, it works out the element the browser would have clicked without the veil, the common ancestor of the pressed element and the element under the veil at the release point, and callsclick()on it once the veil is lowered and no other veil covers it.The issue proposed
pointerdown/pointerup. Mouse events are used instead: with touch, thechange, and so the veil, comes after thepointerup, which then never lands on the veil. The compatibility mouse events see the lost click for the mouse and for touch alike (checked in Chrome and Firefox).What applications see
The click that was lost before now reaches the button once the veil is lowered. It goes through
HTMLElement.click(), so the replayed event is not trusted, carries no coordinates and does not move the focus. No API change, nothing to migrate.Backport
To
wicket-11.xin #2002, a clean cherry-pick, stacked on #2001.wicket-10.xhas no veil.Tests
veil-test.js, with elements fixed on screen so hit-testing works; six fail without the fix.VeilPagegets a field updating on change in one second next to a Save button.VeilPageSeleniumTestclicks Save with a real mouse and taps it with a real touch right after typing, and drags a press off Save onto the field; each checks that the release really landed on the veil. Without the fix the click and tap cases fail in Chrome and Firefox (Save never runs). All 36 cases pass in both.mvn clean verify -Pjs-testis green.