Whither content editable?
Closed this issue · 1 comments
Curious about the state of contenteditable elements and their support for access in purescript relating to existing text selection apis. I've done a fair bit of searching, but only found textarea related items in purescript mostly so far. There's also obviously Web.Util.TextCursor but it seems to be only for textareas.
I'm building something where I'd like to do something akin to this technique from the stackoverflow https://stackoverflow.com/questions/26353478/attaching-keypress-and-focusout-event-to-elements-inside-contenteditable-div, but in purescript:
var node = window.getSelection().getRangeAt(0).commonAncestorContainer;
var nodeParent = node.parentNode;
as I have a div with contenteditable on, and a bunch of spans within that with ids, each of which is in my model for a halogen project and I'd like to determine which piece of data is being focused on, so I can know which piece to update. Hopefully here is the right place to ponder such things. Feel free to point me somewhere else, otherwise.
I started to go down a path similar to that outlined in https://gitlab.iscpif.fr/cgenie/purescript-gargantext/commit/c9536adc8faa205276efa84f2a09cc4c36b4fb1b but I thought maybe I might ask first.
Closing because this has languished.