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

Tags input control has confusing keyboard behavior #3189

Closed
arikfr opened this issue Dec 13, 2018 · 2 comments
Closed

Tags input control has confusing keyboard behavior #3189

arikfr opened this issue Dec 13, 2018 · 2 comments
Assignees
Labels
Frontend: React Frontend codebase migration to React Frontend UX

Comments

@arikfr
Copy link
Member

arikfr commented Dec 13, 2018

image

  1. When the tag suggestion list is open, I expect the Esc key to close it.
  2. Also, when the suggestions are closed, I expect the Enter key to submit the changes.

What in fact happens is that Enter has no effect and Esc cancels the dialog. I assume this is in part due to the hybrid of a React control (tags input) and Angular modal. But once we move to only React in this area, we should revisit the UX.

@arikfr arikfr added Frontend UX Frontend: React Frontend codebase migration to React labels Dec 13, 2018
@ranbena ranbena self-assigned this Jan 28, 2019
@ranbena
Copy link
Contributor

ranbena commented Jan 29, 2019

The default ant-design behavior is:

  • Press esc -> closes suggestions, press esc again -> closes modal (demo). This is the behavior we want and don't have.
  • Press enter -> selects current marked dropdown option. There's no config option to turn it off.
  • Press enter when input is not focus -> nothing happens. It's not a keyboard event the modal listens to.

So first off, gotta fix the modal escape hijacking.

Then, for the extra features I can PR the antd project with new attributes:

  1. <Modal onPressEnter={this.onOK} />
  2. <Select dropdownOnInputOnly={true} />

Wdyt @arikfr?

@arikfr
Copy link
Member Author

arikfr commented Jan 29, 2019

I think that making the Modal not hijack the Esc key is 80% of the solution. If you are going to do it by switching to Ant's Modal here, then no further work is required. I noticed in your demo that I can do:

  1. Click Esc to close suggestions 👌
  2. Hit Tab , Tab , Enter to submit.

It could be nice to make OK come before Cancel in the Tab order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend: React Frontend codebase migration to React Frontend UX
Projects
None yet
Development

No branches or pull requests

2 participants