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

OBPIH-5171 Fix pressing enter when cursor placed in filter field triggers clear filter and page refresh #3669

Conversation

drodzewicz
Copy link
Collaborator

No description provided.

@drodzewicz drodzewicz self-assigned this Nov 29, 2022
@drodzewicz
Copy link
Collaborator Author

To prevent this bug from happening I had to somehow add preventDefault() on input when clicking enter but only when there are no options to choose from because otherwise if I just left preventDefault() without checking for options.length it would prevent user from selecting options using keyboard.
Other problem was how to get number of options and unfortunately since this is FilterSelectField component is an async select options in props always resulted in an empty list so I had to extract a proper options list from one of the custom component which was ValueContainer.

@awalkowiak awalkowiak merged commit 87ca9a2 into develop Nov 29, 2022
@awalkowiak awalkowiak deleted the OBPIH-5171-press-enter-when-cursor-placed-in-filter-field-triggers-clear-filter-and-page-refresh branch November 29, 2022 12:54
awalkowiak pushed a commit that referenced this pull request Nov 29, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants