Skip to content
This repository has been archived by the owner on Sep 10, 2023. It is now read-only.

Improving keyboard management and fix timing issues #816

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fverry
Copy link

@fverry fverry commented Nov 18, 2015

Issues :

  • Autocorrect on iPad messes input
  • On Safari iPad, the <input> is not updated until keydown() has ended,
    despite setTimeout(), which causes do_search() to perform over the
    previous value of the field.
  • Keypress event returns "l" (lowercase "L", ASCII 108) as keyCode,
    which is then confused for KEY.NUMPAD_ENTER (keyCode 108).

Fixes :

  • Disabling autocorrect
  • Updating the KEY array to the latest jQuery UI standard :
    https://github.com/jquery/jquery-ui/blob/e9643f6bfc922773e29e3084e64de0240b547f32/ui/core.js
  • Replacing event.keyCode by jQuery event.which :
    https://api.jquery.com/event.which/
  • Dissociating keydown/keyup effects :
    http://www.quirksmode.org/dom/events/keys.html
    ** Keydown event is used to detect control keys (when the key is
    pressed, meaning that the effect of the key can be overloaded before it
    happens)
    ** Keyup event is used to act upon input changes (when the key is
    released, meaning that the effect of the key has already happened)
    ** Keypress event is not used anymore
    ** Now that do_search() performs only on keyup, the setTimeout() ("just
    long enough to let this function finish.") seems useless.
  • Removed stopPropagation(), preventDefault() when redundant with
    "return false"

* Disabling autocorrect
* Adding keypress support
Improving keyboard management

Issues :
* On Safari iPad, the <input> is not updated until keydown() has ended,
despite setTimeout(), which causes do_search() to perform over the
previous value of the field.
* Keypress event returns "l" (lowercase "L", ASCII 108) as keyCode,
which is then confused for KEY.NUMPAD_ENTER (keyCode 108).

Fixes :
* Updating the KEY array to the latest jQuery UI standard :
https://github.com/jquery/jquery-ui/blob/e9643f6bfc922773e29e3084e64de0240b547f32/ui/core.js
* Replacing event.keyCode by jQuery event.which :
https://api.jquery.com/event.which/
* Dissociating keydown/keyup effects :
http://www.quirksmode.org/dom/events/keys.html
** Keydown event is used to detect control keys (when the key is
pressed, meaning that the effect of the key can be overloaded before it
happens)
** Keyup event is used to act upon input changes (when the key is
released, meaning that the effect of the key has already happened)
** Keypress event is not used anymore
** Now that do_search() performs only on keyup, the setTimeout() ("just
long enough to let this function finish.") seems useless.
* Removed stopPropagation(), preventDefault() when redundant with
"return false"
@fverry fverry changed the title Enhancements for iPad Improving keyboard management Nov 24, 2015
* When multiple ajax queries are sent, they might answer in the wrong
order ; now the previous ajax query is aborted before the new one is
executed
* If backspace is hit, and the char length is reduced under minChars,
the run_search() timeout is not cleared ; now it is cleared
@fverry fverry changed the title Improving keyboard management Improving keyboard management and fix timing issues Jan 4, 2016
@loopj loopj force-pushed the master branch 2 times, most recently from fd2316b to 8a8390e Compare August 3, 2023 06:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant