Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

openOnFocus breaks blur #73

Closed
cauld opened this issue Jan 27, 2017 · 5 comments
Closed

openOnFocus breaks blur #73

cauld opened this issue Jan 27, 2017 · 5 comments
Labels

Comments

@cauld
Copy link
Contributor

cauld commented Jan 27, 2017

When setting openOnFocus to true the original collapsed state of the input is not reset when focus is lost. The label remains floated and the input is still underlined.

This setState block is never hit to set isFocused back to false.

You can see this in the open on focus storybook example. Click into the input and then tab out. Doing the same in other examples where openOnFocus is not used demonstrates the proper behavior.

@leMaik
Copy link
Member

leMaik commented Jan 27, 2017

Thank you for the bug report and locating the issue. 👍 Would you like to submit a PR that fixes it?

@cauld
Copy link
Contributor Author

cauld commented Jan 29, 2017

I played around with this for a while. It is a minor timing issue. There might be a better way to handle this, but so far this is the simplest solution I've come up.

leMaik added a commit that referenced this issue Jan 29, 2017
handleInputBlur must pause before checking autocomplete status to support openOnFocus (issue #73)
@leMaik
Copy link
Member

leMaik commented Jan 29, 2017

Well, it's kind of an ugly hack, but that's the trade-off when you try to re-use components that aren't really made for making new components. 😕 Hopefully, this will improve when the next branch of Material-UI is ready and the chip input can be ported to use it.

Thank you for the fix! 👍

@leMaik leMaik closed this as completed Jan 29, 2017
@cauld
Copy link
Contributor Author

cauld commented Jan 30, 2017

Agreed, no problem. Will you be doing a new release soon that includes this fix? Would like to switch back to the official npm package.

@leMaik
Copy link
Member

leMaik commented Jan 30, 2017

@cauld Thanks for the hint, I just released v0.12.2 which includes the fix. 👍

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

No branches or pull requests

2 participants