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

onBlur issue #16

Open
murphyke opened this issue Jun 5, 2018 · 2 comments
Open

onBlur issue #16

murphyke opened this issue Jun 5, 2018 · 2 comments

Comments

@murphyke
Copy link

murphyke commented Jun 5, 2018

I have an onBlur handler for the autosuggest box that sets state. However, if the blur happens because the user clicked the submit button, the submit event never happens. My understanding is that React cancels events after the blur due to the setting of state.

With a regular onBlur handler I could check the event's relatedTarget and conditionally set the state. However, the autosuggest component only passes its value to the onBlur handler.

I will try delaying the blur handler's functionality with a timeout, but ... I miss the event properties.

@murphyke
Copy link
Author

murphyke commented Jun 7, 2018

I have a much more accurate description and recipe for reproduction.

Actually, the real problem is that, when the suggestion dropdown-menu ul is displayed and Autosuggest's input element has focus, clicking a submit button doesn't trigger a click/submit event. If the disclosure/toggle button has focus while the menu is displayed, the problem does not occur.

There is one minor and superficially bizarre exception to the above conditions: if the user types nothing but space characters, the problem doesn't occur.

It would be common for a user to type a novel value in the autosuggest box and then click the submit button, so I'd like to help fix this if possible within the next few weeks.

Any tips on what might need changing to fix this?

@trevorr
Copy link
Collaborator

trevorr commented Jun 10, 2018 via email

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

No branches or pull requests

2 participants