Tap to open flydown, double-tap to edit on touch devices - #90
Open
preetvadaliya wants to merge 1 commit into
Open
preetvadaliya wants to merge 1 commit into
preetvadaliya wants to merge 1 commit into
Conversation
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.
Fixes #40
On touch screens the flydown for a variable name could never be opened: it only appears on mouse hover, and a finger fires
pointerover → pointerdown → pointerup → pointeroutwithin a few milliseconds, sopointeroutcancels the 500 ms hover timer before it fires.This gives touch its own gestures, decided per event from
pointerType. Mouse and pen are unchanged.How it works
showEditor_(e)now looks ate.pointerType. Fortouch, the first tap callsshowFlydown_(); a second tap on the same field withinFieldFlydown.DOUBLE_TAP_TIMEOUT(500 ms) opens the editor when the field isEDITABLE. Everything else keeps the old code path.onMouseOver_no longer arms the hover timer for touch.lastTapField_/lastTapTime_), because thepointerdownof every tap already hides the flydown throughhideChaff().showFlydownMaker_checkedthis.htmlInput_withthisbound towindow; it now checks the field, so hovering no longer opens the flydown over an open inline editor.Testing
test/field_flydown_touch.mocha.js(22 cases): single, double and slow taps; non-editable fields; tapping another field; dragging; fields in flyouts; mouse, pen and missingpointerType; hover timer per input type; dispose.npm test: 110 passing.PointerEvents through Blockly's gesture pipeline: tap → flydown, second tap → editor, slow second tap → flydown, mouse click → editor, mouse hover → flydown, touch pointerover alone → nothing.Also documents the gestures in
FIELDS.md/README.md, addssinonas a devDependency and bumps the package to 11.0.4.