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

DateInput popover does not close on tab blur #2901

Closed
chiubaka opened this issue Sep 3, 2018 · 1 comment
Closed

DateInput popover does not close on tab blur #2901

chiubaka opened this issue Sep 3, 2018 · 1 comment

Comments

@chiubaka
Copy link

chiubaka commented Sep 3, 2018

Environment

  • Package version(s): @blueprintjs/core 3.3.0; @blueprintjs/datetime 3.1.0
  • Browser and OS versions: Firefox 61.02 (64-bit); macOS High Sierra 10.13.6

Steps to reproduce

  1. Create a tabbable form including a DateInput.
  2. Attempt to tab through the form.

Actual behavior

When hitting tab to move from a DateInput to the next input, the DateInput's calendar popover does not dismiss. Interestingly, if shift-tabing backwards, DateInput does dismiss the popover.

Expected behavior

As we are no longer focused on the DateInput, it seems like the DateInput's calendar popover should dismiss.

Possible solution

Close the popover when tab is pressed in a DateInput.

@svilendobrev
Copy link

as a workaround: pass inputProps: {
onKeyDown: function( e) {
if (e.which === Keys.TAB && !e.shiftKey)
this.refs.yourref.setState({ isOpen: false })
}}

inputProps:onBlur does not work correctly with opened daypicker, it seems to fire before value is ever set.

cetra3 pushed a commit to cetra3/blueprint that referenced this issue Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants