-
-
Notifications
You must be signed in to change notification settings - Fork 839
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
web: Implement pasting text using Clipboard API #16692
Conversation
As for the first commit, cf.: torokati44@df91395 I'm not saying that you should use this verbatim, but the comments therein might be worth considering. |
Does a plain |
TBH I created a modal for pure consistency with other UI elements (also, I took inspiration from other sites which show a similar message), but now that you mentioned, it does have a bit of that vibe, yes 😄 |
TBH if there's no compelling technical reason against it, I'd still prefer it I think. This "plain black text on white background" thing, just to tell the user a short message, is not the nicest IMHO. |
I'm fairly against alert for something so verbose, personally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks! I definitely prefer a modal over an alert as well. One small thing though, we might want to show the modal if the user denies the clipboard permission so they know there's an alternative way to paste without giving the site that extra permission they might not be comfortable with.
FWIW I have accepted the overruling of my preference toward |
We could also add some text to the context menu when e.g. pasting fails, but that only gives us a limited amount of space. As a follow up: It would be nice if all our modals would use |
This reverts commit 5b7c48e. Co-authored-by: TÖRÖK Attila <torokati44@gmail.com>
The custom RUSTFLAGS from CI overrides .cargo/config.toml.
The current implementation was synchronous only, so that when an async callback was used, the menu was being disposed prematurely. This patch ensures that in case of asynchronous callbacks, the menu will be disposed after they finish.
This modal informs the user that they can use shortcuts for copy, cut, and paste instead of using the context menu. This modal is meant to be displayed when the browser does not support reading the clipboard, or the user denies permission to the clipboard.
Ruffle does not have direct clipboard access on web, so the current paste implementation from the context menu does not work. This patch intercepts the paste context menu callback, and uses the Clipboard API to ask the browser for the clipboard and update it before calling the callback. When the Clipboard API is not available or the user denies clipboard permission, a modal informing the user about cut, copy, paste shortcuts is displayed.
Fixes #16678.
Ruffle does not have direct clipboard access on web, so the current paste implementation from the context menu does not work. This patch intercepts the paste context menu callback, and uses the Clipboard API to ask the browser for the clipboard and update it before calling the callback. When the Clipboard API is not available, a modal informing the user about cut, copy, paste shortcuts is displayed.