From a UX perspective I have noticed that a lot of my users (especially people who favor the keyboard) will begin typing, choose a term and then when they notice the highlighted input that is waiting for the next term they hit ESC on the keyboard. This keypress should be treated just like clicking the mouse off the widget.

CommentFileSizeAuthor
#1 keydown-2012742.patch454 bytesbleen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bleen’s picture

Title: ESC key should remove focus » keypress does not work for some chars in Chrome ... use keydown instead
Category: feature » bug
Status: Active » Needs review
FileSize
454 bytes

It turns out that the reason ESC was not working for me is that keypress does not get fired for ESC (or backspace) because for some reason Chrome does not fire keypress for some keys but it does fire keydown

this patch solves the bug

sepgil’s picture

Status: Needs review » Needs work

I recently changed that line from keydown to keypress because of this issue #1626980: Can't enter specific letter. So we'll have to find another way to fix this.

bleen’s picture

Based on the definition here: http://unixpapa.com/js/key.html keypress should be used only for characters and keydn should be used for all keys ...

I would argue that its actually the other issue that needs to be revisited since the fix there broke this...

Should I move this discussion to that issue?

sepgil’s picture

What we should do, is move the backspace stuff into a keydown function and leave the comma/delimiter key stuff in keypress
I think it's okay if we discuss that in here.