Created
August 23, 2017 10:06
-
-
Save barneycarroll/cbe78d7f4511090550dcd062f0bfaa2c to your computer and use it in GitHub Desktop.
Insert text pointer at expected location after injecting an element into contenteditable via external UI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dom.focus() | |
const range = document.createRange() | |
range.setStart(selection.anchorNode.nextSibling.nextSibling, 0) | |
range.collapse(true) | |
selection.removeAllRanges() | |
selection.addRange(range) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment