Insert Text at cursor position inside text
Question
Hi, We are evaluating GrapesJS for one of requirement. As part of the evaluation i am creating custom command 'insert placeholder', what it does is ( what i am planning to do ) is when a select Text and when i click this command , it should insert text at the selected cursor position. Initially i had done this var existingData = selectedComponent.view.el.firstChild.data; var placeHolderData = '[[1# PlaceHolder Name]]'; existingData = existingData + " "+placeHolderData; console.log("existingData ",existingData); selectedComponent.set('content', existingData); this is only appending text. My re...
Answers (3)
Duplicate with #481
Thanks
Similar to what I did in grapesjs-plugin-customrte. But I no propose my code to be based on, at it is mess. You should able to test the code in design,html in my repo. Also can set lower priority for implement el.contentEditable, so that the placeholder text is not editable. #287 If it is a block t...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1622
Default selected font issue for custom font in the Typography.
There is one font issue when i click on any element it not show the current font of the element, i added custom code for add my custom font...
Issue #1714
auto select componet in RTE
When I add a link from RTE, it is not selected as the link component, I have to deselect the parent component that is the TEXT and select a...
Issue #1706
[Question]: How to get href from rte?
I have this rte toolbar where you can type and click 'save' and it's going to create a link for the selected text. but the problem is that...
Issue #1669
[Question] Custom link modal doesn't update the current text but add another text with link
Hello Artur, I'm trying to have a custom modal when clicked link button in RTE. but it doesn't convert selected text to link but what it do...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Related tutorials
In-depth guides on the same topic.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.