Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions will hide when input combined character on IE #388

Merged
merged 2 commits into from
Jun 26, 2017
Merged

Suggestions will hide when input combined character on IE #388

merged 2 commits into from
Jun 26, 2017

Conversation

KeitaMoromizato
Copy link
Contributor

I tried input Japanese(Kanji) on IE 11. But suggestions hide when enter key press.

For combine character, Should ignore keyCode=229 in onKeyDown.

@moroshko
Copy link
Owner

Sorry, I'm not familiar with combined characters.
Does the issue exist only in IE11, or reproducible in Chrome as well?
Is the issue reproducible on the homepage examples?
Could you paste here the characters you type in the Autosuggest?

@KeitaMoromizato
Copy link
Contributor Author

Reproduced on the this example.
I change code like this

const languages = [
  {
    name: 'にほん',
    year: 1972
  },
  {
    name: 'にほんご',
    year: 2000
  }
]

and type にほん(nihon) use Japanese Kana input mode.

This issue reproduce only IE 11. Because other browser fired onChange event (and re-update suggestion) after enter key pressed. Maybe it's IE bug, but keyCode=229 does not mean "Input finished", means "Inputting". So I think should not call closeSuggestions in this case.

@KeitaMoromizato
Copy link
Contributor Author

FYI

const languages = [
  {
    name: 'にほん',
    year: 1972
  },
  {
    name: 'にほんご',
    year: 2000
  }
]

and

  1. Typed にほん(nihon
  2. Press space key, and choose Kanji(にほん = 日本)
  3. Press enter, decide Kanji
    => hide suggestions

test

Copy link

@kivikakk kivikakk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the keyCode spec:

  1. If an Input Method Editor is processing key input and the event is keydown, return 229.

So keydown with keyCode 229 should be ignored, per this PR.

@moroshko
Copy link
Owner

@kivikakk @KeitaMoromizato Wouldn't it make sense to ignore keyCode 229 always, not just for Enter?

@KeitaMoromizato
Copy link
Contributor Author

"KeyCode 229" event fire only from Enter pressed. So KeyCode 229 is part of enter pressed event. Therefore I wrote in Enter key handling section.

@moroshko moroshko merged commit bf5adbd into moroshko:master Jun 26, 2017
@moroshko
Copy link
Owner

v9.3.1 includes this fix.

@KeitaMoromizato @kivikakk Thanks for the contribution!

@cdeutsch
Copy link

cdeutsch commented Mar 8, 2018

I don't understand how you'd ever hit the fix

You'd only get to that line if keyCode was 13 right? It would never be 229 if you got there unless it's changing as soon as it's read.
¯_(ツ)_/¯
I'm not running into the issue or anything just confused how this fixed anything.

@KeitaMoromizato did you verify this fixed your problem?

@ekilah
Copy link

ekilah commented Sep 11, 2018

I am also a non-affected observer who just happened upon the comment in the code and was curious, and I agree with @cdeutsch that the fix is no longer doing anything, but it is probably not the fault of the author -

if you look at the PR's code, the library used to switch on event.key (i.e. case 'Enter':) whereas now it switches on event.keyCode (i.e. case 13:). my guess is that now that the keyCode is being used instead of the text 'Enter', things aren't broken anymore?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants