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: prevent blur when selecting text #4762

Merged
merged 3 commits into from
Sep 18, 2023
Merged

fix: prevent blur when selecting text #4762

merged 3 commits into from
Sep 18, 2023

Conversation

kwasniew
Copy link
Contributor

About the changes

Selecting text in search suggestions was triggering blur and hiding all the suggestions:
Screenshot 2023-09-18 at 13 51 07

Important files

Discussion points

@vercel
Copy link

vercel bot commented Sep 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2023 0:24am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Sep 18, 2023 0:24am

@@ -114,7 +114,6 @@ export const Search = ({
useKeyboardShortcut({ key: 'Escape' }, () => {
if (searchContainerRef.current?.contains(document.activeElement)) {
searchInputRef.current?.blur();
hideSuggestions();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

blur effect handler will handle it automatically

setTimeout(() => {
if (
!mouseDownInside &&
Copy link
Contributor Author

Choose a reason for hiding this comment

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

mouse down inside suggestions should not close them

Copy link
Contributor

@FredrikOseberg FredrikOseberg left a comment

Choose a reason for hiding this comment

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

LGTM

@kwasniew kwasniew merged commit 4484615 into main Sep 18, 2023
15 checks passed
@kwasniew kwasniew deleted the fix-selectable-search branch September 18, 2023 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants