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 click-to-copy on Safari #3621

Merged
merged 1 commit into from
Nov 24, 2023
Merged

Conversation

emilk
Copy link
Owner

@emilk emilk commented Nov 24, 2023

Follow-up to #3513

Safari only allows access to the clipboard as response to user action, so we need to take an extra logic step right in the event handler.

@emilk emilk added bug Something is broken eframe Relates to epi and eframe web Related to running Egui on the web labels Nov 24, 2023
@emilk emilk merged commit 0d24a3a into master Nov 24, 2023
36 of 37 checks passed
@emilk emilk deleted the emilk/fix-click-to-copy-on-safari branch November 24, 2023 08:06
emilk added a commit that referenced this pull request Nov 24, 2023
* Follow-up to #3621 and
#3513

To work around a Safari limitation, we run the app logic in the event
handler of copy, cut, and mouse up and down.

Previously the output of that frame was discarded, but in this PR it is
now saved to be used in the next requestAnimationFrame.

The result is noticeable more distinct clicks on buttons (one more frame
of highlight)

Bonus: also fix auto-save of a sleeping web app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken eframe Relates to epi and eframe web Related to running Egui on the web
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy button doesn't work on Safari
1 participant