jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.68k stars 2.4k forks source link

Filterble widget handles the enter key incorrectly #8571

Closed pstanton closed 7 years ago

pstanton commented 7 years ago

if you are typing into the text field, then press enter nothing happens, but then your next key press has no effect. eg:

  1. focus on text field
  2. press a ('a' appears in field)
  3. press enter (no change)
  4. press a (no change)
  5. press a ('aa' appears in field)

this can be easily reproduced on the demo page

Palestinian commented 7 years ago

It looks like by removing event.preventDefault() in _onKeyPress solves it. Because event is already prevented in _onKeyDown.

_onKeyPress: function(event) {
  if (this._preventKeyPress) {
    //event.preventDefault();
    this._preventKeyPress = false;
  }
},

http://jsfiddle.net/Palestinian/tv5m0oyg/

apsdehal commented 7 years ago

No longer an issue with latest master, closing for now. I will reopen if I find it after more testing.