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

[dropdown] JS error when typing if dropdown open #3027

Open
AllanJard opened this issue Mar 28, 2024 · 2 comments
Open

[dropdown] JS error when typing if dropdown open #3027

AllanJard opened this issue Mar 28, 2024 · 2 comments
Assignees
Labels
tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build type/bug Any issue which is a bug or PR which fixes a bug
Milestone

Comments

@AllanJard
Copy link

Bug Report

When a dropdown is open, if you type a letter to match a label in the dropdown, an error occurs:

semantic.min.js?v=2.9.3:11 Uncaught TypeError: Cannot read properties of undefined (reading 'hasClass')
    at Object.selectedLetter (semantic.min.js?v=2.9.3:11:125968)
    at HTMLDivElement.keydown (semantic.min.js?v=2.9.3:11:114089)
    at HTMLDivElement.dispatch (jquery.min.js:2:40035)
    at v.handle (jquery.min.js:2:38006)
selectedLetter @ semantic.min.js?v=2.9.3:11
keydown @ semantic.min.js?v=2.9.3:11
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2

Note that you have to type a letter to match a label in the dropdown. If there isn't an entry starting with the letter given, no error will occur.

Steps to reproduce

  1. Go to https://fomantic-ui.com/modules/dropdown.html
  2. Open the "Pet" dropdown (second one on the page - I found it easier to reproduce here than the "File" dropdown - possibly a label / value thing?)
  3. Type "d" on your keyboard
  4. Note the JS error in the browser's console.
  5. Note also that "Dog" is selected
  6. Type "e" - no error
  7. Type "c" (cat) - the error occurs again.

Expected result

No error should be produced. The selected element class is being moved as expected, so I'm not clear if the error is actually stopping any functionality, but the fact that it is happening, means something unexpected is going on.

Actual result

The UI appears to be functional, but the JS error is unexpected.

Testcase

Happens on the Fomantic UI examples: https://fomantic-ui.com/modules/dropdown.html .

Version

2.9.3.

@AllanJard AllanJard added state/awaiting-investigation Anything which needs more investigation state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/bug Any issue which is a bug or PR which fixes a bug labels Mar 28, 2024
@lubber-de lubber-de self-assigned this Mar 28, 2024
@lubber-de lubber-de added this to the 2.9.4 milestone Mar 28, 2024
@lubber-de
Copy link
Member

Fixed by #3028
Thanks for reporting!

@lubber-de lubber-de added state/has-pr An issue which has a related PR open and removed state/awaiting-investigation Anything which needs more investigation state/awaiting-triage Any issues or pull requests which haven't yet been triaged labels Mar 28, 2024
@AllanJard
Copy link
Author

Amazingly quick! Putting the rest of us to shame ;-). Thank you for the fix!

@lubber-de lubber-de added tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build and removed state/has-pr An issue which has a related PR open labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

No branches or pull requests

2 participants