-
Notifications
You must be signed in to change notification settings - Fork 64
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
Clipboard API support #109
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some clipboard functions require synchronous access to methods, like on the
copy
event usingclipboardData.setData
or thepaste
event andclipboardData.getData
. If I handle thecopy
event in Elm and use a port from Elm to JS, it won't be handled synchronously by js. If I handle thecopy
event in a custom element in js, I run into the same issue trying to get the data back to JS (e.g. there's no two way synchronization technique that I know of). I think one workaround to this would be to add clipboard API support to theBrowser.Events
module and/or add specializedonCopy
andonPaste
functions toHtml.Events
module.Note that one workaround for getting clipboard data on the
paste
event was to use a custom element to listen to the event, then using a custom event with the types of data I wanted (e.g.clipboardData.getData('text/html')
), dispatching that, and then handling the event in Elm. You can see it here: https://github.com/mweiss/elm-rte-toolkit/blob/1.0.1/js/elmEditor.js#L303However, I do not know of a corresponding solution to
clipboardData.setData
.The text was updated successfully, but these errors were encountered: