Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Prevent keyboard events during text composition inside of details-menu #40

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

Merged
merged 3 commits into from
Nov 15, 2019

Conversation

muan
Copy link
Contributor

@muan muan commented Oct 23, 2019

For reference: https://github.com/github/web-systems/issues/228.

Like #38 and #39 this aims to better support having text inputs inside of <details-menu>. This one can be merged independently.

For background on this approach, refer to the research I've done when fixing github/combobox-nav#2. (event.isComposing is not supported in non-Chromium Edge)

You can test this locally with an IME of your choosing and with this simple markup:

  <details open>
    <summary>Best robot: <span data-menu-button>Unknown</span></summary>
    <details-menu>
      <input autofocus>
      <button type="button" role="menuitem" data-menu-button-text>Hubot</button>
      <button type="button" role="menuitem" data-menu-button-text>Bender</button>
      <button type="button" role="menuitem" data-menu-button-text>BB-8</button>
    </details-menu>
  </details>

In the GIFs I was testing with bopomofo. You can do the same by following Apple's instruction.

before after
Pressing up/down arrow cancels composition and moves focus. Pressing escape closes menu. Pressing up/down arrow starts composition. Pressing escape stops composition.

@muan muan requested a review from a team October 23, 2019 19:53
Copy link
Contributor

@koddsson koddsson left a comment

Choose a reason for hiding this comment

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

This looks good to me ✨

@dgraham dgraham mentioned this pull request Nov 8, 2019
Copy link
Contributor

@keithamus keithamus left a comment

Choose a reason for hiding this comment

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

Excellent! Agree with @dgraham's comments

@muan muan merged commit b1bb4fe into master Nov 15, 2019
@muan muan deleted the composition branch November 15, 2019 22:11
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.

4 participants