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

Fix an issue with the combobox listbox closing on keyUp #773

Closed
wants to merge 3 commits into from

Conversation

heisand
Copy link
Contributor

@heisand heisand commented Aug 4, 2023

Background

When clicking inside the input field, if you do not hit the lable, the listbox with suggestions will close. Somehow it seems that an onKeyUp triggers that, but when hitting the lable it seems that the key up does not have enough time to do so because we click via the label first.. or something like that.

Illustrations

Illustrated in the first part of this recording.

Screen_Recording_2023-07-18_at_12.39.01.mov

Solution

The reason this happens is somehow that the inputRef specifically has type HTMLInputElement here. I believe that we really do not need to specify the type in this case (and now the listbox stays open when it should).

@heisand heisand requested review from a team, selbekk, emildohlenhansen, cecilmkl and AnamaP and removed request for a team August 4, 2023 11:20
@changeset-bot
Copy link

changeset-bot bot commented Aug 4, 2023

🦋 Changeset detected

Latest commit: bcba3d3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@vygruppen/spor-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@heisand heisand changed the title Fix an issue with the listbox closing on keyUp Fix an issue with the combobox listbox closing on keyUp Aug 4, 2023
@selbekk
Copy link
Contributor

selbekk commented Aug 4, 2023

Removing type information fixes a behavioral bug? I don't get how that's possible. But hey, if we don't need it, i'm all for it.

@heisand
Copy link
Contributor Author

heisand commented Aug 4, 2023

Removing type information fixes a behavioral bug? I don't get how that's possible. But hey, if we don't need it, i'm all for it.

I agree about the oddity of that, and now it does not work again.. but some of my other changes locally fixed it, so I have to double check what actually fixed it..

@heisand heisand closed this Aug 7, 2023
@selbekk selbekk deleted the combobox-fix branch September 7, 2023 20:03
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.

2 participants