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 closing issues with combobox #774

Merged
merged 2 commits into from
Aug 7, 2023
Merged

Fix closing issues with combobox #774

merged 2 commits into from
Aug 7, 2023

Conversation

heisand
Copy link
Contributor

@heisand heisand commented Aug 7, 2023

Background

When clicking inside the input field, if you do not hit the label, the listbox with suggestions will close. This seems to be due to the useOutsideClick (When hitting the label, it does not seem that the useOutsideClick has enough time to trigger, because we click via the label first). The popover already seems to have an outsideClick functionality, and with useOutsideClick, the functionality is duplicated and cancels each other out.

It is also not possible to double click inside the input field while the listbox is open, this should be possible to be able to copy written input.

Illustrations

Issue illustrated in the first part of this recording.

Screen_Recording_2023-07-18_at_12.39.01.mov

Solution

Remove the useOutsideClick hook.

Add the isNonModal prop to the popover to make double clicking inside the input field possible.

@changeset-bot
Copy link

changeset-bot bot commented Aug 7, 2023

🦋 Changeset detected

Latest commit: d0729de

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 requested review from a team, selbekk, emildohlenhansen, cecilmkl and AnamaP and removed request for a team August 7, 2023 06:08
Copy link
Contributor

@selbekk selbekk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job! 💪

@selbekk selbekk merged commit 003cefc into main Aug 7, 2023
1 check passed
@selbekk selbekk deleted the fix-combobox-2 branch August 7, 2023 06:14
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