Question: how to move the cursor to be the end of newly inserted tag?
See original GitHub issueI’ve made some function to insert a special tag, but the cursor after inserting is before the tag. How to move it to the end of the new tag?
pickup: function(e: any) {
e.preventDefault();
e.stopPropagation();
const [variableKey, target] = extractAttrValue(
e.target,
"data-variable-key",
(target: any) => /UL/i.test(target.tagName)
);
if (variableKey) {
const variablePlaceholder = target.textContent;
// @ts-ignore
const node = this.util.createElement("var");
node.setAttribute("data-node-type", "variable");
node.setAttribute("data-variable-key", variableKey);
node.setAttribute("contenteditable", false);
node.textContent = variablePlaceholder;
// @ts-ignore
this.insertNode(node);
// todo move cursor to the end ?
// @ts-ignore
this.history.push(false);
}
// @ts-ignore
this.submenuOff();
// @ts-ignore
this.focus();
}
};
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
how to move the cursor to be the end of newly inserted tag ...
I've made some function to insert a special tag, but the cursor after inserting is before the tag. How to move it to...
Read more >vim - move cursor after inserted text - Stack Overflow
After a put command ("p" or "P") the cursor is sometimes placed at the first inserted line and sometimes on the last inserted...
Read more >How to place cursor position at end of text in text input field ...
In this article, we are going to learn about how to place the cursor at end of the text in a text input...
Read more >Moving cursor beyond shapes and text boxes I've just inserted
After your last paragraph before the shapes, create a space big enough for the shapes to go into and then start typing a...
Read more >Keyboard shortcuts for Google Docs - Android
Keyboard shortcuts for Google Docs ; Move to the end of the table, hold Ctrl + Alt + Shift, press t then d...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
😃 BTW, I found the user functions are useful, such as uploadImage and insertHTML. but we can’t use them in core when writing plugin 😦
The 2.26.0 version has been updated. If there is an issue, please register as a new issue. Thank you.