Open jhbrown94 opened 4 years ago
Similarly, trying to arrow-key past the end of text causes the caret to reset to the start of text.
Thanks for the bug report. I appreciate that editable areas are an important reason for this polyfill. I've been on holiday and I'll look in the next couple of days.
Thanks, Sam. After I filed this, I came to believe supporting contenteditable it was going to involve more substantial rework, so I started in on a variant approach, heavily influenced by what youall have done here. I'll let you know if I get it to a shareable state.
Jeremy
On Mon, Sep 14, 2020 at 12:59 AM Sam Thorogood notifications@github.com wrote:
Thanks for the bug report. I appreciate that editable areas are an important reason for this polyfill. I've been on holiday and I'll look in the next couple of days.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/GoogleChromeLabs/shadow-selection-polyfill/issues/8#issuecomment-691810803, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZFQ5TLUHRBHHWX6M7AGP3SFWPMTANCNFSM4RANHDAQ .
FWIW, I just released my effort at v0.1.1 -- https://www.npmjs.com/package/@jhbrown94/selectionrange
Thanks for contributing in this space! Your code seems much more well documented than mine :)
I want these polyfills to go away, obviously, and some better spec to appear (I know that Safari doesn't like this spec but has something else in mind). But there's definitely room for innovation here, thanks.
On Thu, 17 Sep 2020 at 05:56, Jeremy H. Brown notifications@github.com wrote:
FWIW, I just released my effort at v0.1.1 -- https://www.npmjs.com/package/@jhbrown94/selectionrange
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/GoogleChromeLabs/shadow-selection-polyfill/issues/8#issuecomment-693631945, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA5DEDSGHQ2A7FZP46UX7LSGEJ7DANCNFSM4RANHDAQ .
Thanks for the kind words. And also, the code and techniques -- I would not have thought to split characters off to modify selection!!
And yeah, a real spec for this would be great -- the inconsistencies are murder. From Googling around it seems like this issue is pretty stalled out at the moment, though.
On Safari: If you embed a contenteditable div in a shadow dom, when you hit return, the caret jumps back to the beginning of the div.
Here's code to reproduce. HTML:
JS -- custom element definition: