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 the arrow down key on the keyboard, causes SuggestBox to throw an Exception #648

Closed
FrankW76 opened this issue Apr 14, 2022 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@FrankW76
Copy link
Contributor

Describe the bug
When you have SuggestBox.
Give it focus.
Press down on the keyboard. An Exception will appear.

This is because arrow down will try to select the next item in the dropdown. But the dropdown is not yet available at that moment.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://demo.dominokit.org/forms/advanced-form-elements
  2. Open the developer tools of your browser, and open the console
  3. On this page you can find a SuggestBox with a label : Your friends
  4. Click on this SuggestBox to give it focus
  5. Now press the 'arrow down' key of your keyboard
  6. An Exception will appear in the develor tools console (Cannot read properties of undefined)

The problem with above is, that we use an 'uncaughtExceptionHandler' in our own app. Which shows a big error for all these errors. And thus every time a user tries above steps, he gets a big error dialog.

Expected behavior
Do not throw an exception

Screenshots

1
2
3

Desktop (please complete the following information):

  • OS: Windows
  • Browser Chrome
  • Version Latest
@FrankW76
Copy link
Contributor Author

DropDownMenu.java

Modify the focus method to below code, will fix this issue.

public void focus() { if (keyboardNavigation != null) keyboardNavigation.focusAt(0); }

@vegegoku vegegoku self-assigned this Apr 14, 2022
@vegegoku vegegoku added the bug Something isn't working label Apr 14, 2022
@vegegoku vegegoku added this to the 1.0.0-RC13 milestone Apr 14, 2022
@vegegoku vegegoku changed the title Pressing the 'arrow down' key on the keyboard, causes SuggestBox to throw an Exception Pressing the arrow down key on the keyboard, causes SuggestBox to throw an Exception Apr 14, 2022
vegegoku added a commit that referenced this issue Apr 14, 2022
vegegoku added a commit that referenced this issue Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants