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

Pressing enter in a TextBox shouldn't blur it #192

Closed
fwextensions opened this issue Sep 17, 2023 · 3 comments · Fixed by #201
Closed

Pressing enter in a TextBox shouldn't blur it #192

fwextensions opened this issue Sep 17, 2023 · 3 comments · Fixed by #201
Labels
enhancement New feature or request

Comments

@fwextensions
Copy link

I see this code in the raw-textbox.tsx:

      if (key === 'Enter') {
        event.currentTarget.blur()
        return
      }

I'm not sure why an input field should ever blur itself, as opposed to letting some other code change the focus. If you really want to blur it on enter, you could do it in onKeyDown. But there's currently no way to override this built-in behavior.

@yuanqing
Copy link
Owner

Agreed. I’m working on some larger (potentially breaking) changes across the UI library, including a way to make this configurable

@yuanqing yuanqing added the enhancement New feature or request label Sep 17, 2023
@fwextensions
Copy link
Author

Looks like this happens in dropdowns as well, presumably because keyboard focus is tied to the menu visibility, which I noted in #193.

@yuanqing yuanqing mentioned this issue Oct 17, 2023
@yuanqing yuanqing linked a pull request Oct 17, 2023 that will close this issue
@fwextensions
Copy link
Author

This is working great in v3!

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

Successfully merging a pull request may close this issue.

2 participants