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
# 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
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.
Backport of #1996 to
wicket-11.x, for GitHub issue #1944.Stacked on #2001, the 11.x backport of #1995. Its base is
veil-keyboard-1943-11.x, so the diff shows only this fix. Merge #2001 first; GitHub then retargets this PR towicket-11.x.VeilPageSeleniumTestclicks and taps it with a real mouse and touch.No API change, nothing to migrate. The click that was lost before now reaches the button once the veil is lowered.
Verified on this branch:
mvn clean verify -Pjs-testis green, japicmp included.This goes in after #1996. If #1996 changes in review, this branch gets the same change.