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

Selection API support #110

Open
mweiss opened this issue Apr 9, 2020 · 0 comments
Open

Selection API support #110

mweiss opened this issue Apr 9, 2020 · 0 comments

Comments

@mweiss
Copy link

mweiss commented Apr 9, 2020

Currently, there's no way of handling the selection API directly Elm. The way I've worked around this was by creating a webcomponent to track the current selection state, and using custom events to notify Elm of how the state has changed. I also used relative paths in the HTML to distinguish which elements were selected, and a custom Node type separate from the opaque Html/ VirtualDom.Node type referenced in the Html module to resolve the selection. https://github.com/mweiss/elm-rte-toolkit/blob/1.0.1/js/elmEditor.js#L142

It would be nice if there were some way of keeping track of this in Elm directly without requiring a webcomponent, either with a global selection API in browser package that would keep track of this information, or with some limited support in Html.Events for a selection event that would give the selection state relative to the element.

On the discourse, there was a similar proposal a few years ago: https://discourse.elm-lang.org/t/selection-api-for-elm/1351

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant