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: Canceling text selection in Safari broken after usePress refactor #7774

Merged
merged 1 commit into from
Feb 15, 2025

Conversation

devongovett
Copy link
Member

Noticed a small regression from the usePress refactor: text selection was no longer being canceled in Safari on desktop. For example when clicking quickly on an item in a GridList in the docs the text would be selected. This previously worked because preventDefault stops text selection, but after removing that we rely on setting user-event on pointer down. This worked in Chrome and Firefox, but Safari still doesn't support user-select and requires a prefixed -webkit-user-select property instead. Updated the code to detect the correct property to use.

@devongovett devongovett mentioned this pull request Feb 14, 2025
5 tasks
@rspbot
Copy link

rspbot commented Feb 14, 2025

@devongovett devongovett added this pull request to the merge queue Feb 15, 2025
Merged via the queue into main with commit 988096c Feb 15, 2025
30 checks passed
@devongovett devongovett deleted the text-selection-safari branch February 15, 2025 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants