BUG: Can not add a link: getModel() fails with: TypeError: $ is not a function
Question
GrapesJS version
- I confirm to use the latest version of GrapesJS
What browser are you using?
Chrome Version 119
Reproducible demo link
https://jsfiddle.net/bj7afw63/1/
Describe the bug
How to reproduce the bug?
- Load the fiddle
- Try to add a link with the default RTE (not CKE)
- Nothing happens in the UI and a JS error appears in the console: TypeError: $ is not a function
What is the expected behavior? A link is added in the UI inside the mj-text component.
What is the current behavior? The link is not added.
What I found out so far I tracked the error to the GJS method: getModel().
It appears that the mj-text component does not have the el.__cashData.
Just returning the el is also not a solution as this leads to other problems:
TypeError: model_1.once is not a function
But the link is added to the editor.
I assume this is related to mj-text being defined on the outside <tr> instead of the passed in <div>:
<tr data-gjs-type="mj-text" class="gjs-selected">
<td>
<div contenteditable="true">
Hello World
</div>
</td>
</tr>
Code of Conduct
- I agree to follow this project's Code of Conduct
Answers (0)
No answers yet.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #4449
BUG: Lists not working with default RTE
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Version 102.0.5005.115 (Official Bu...
Issue #6706
BUG: TypeError: e.getRoot is not a function (Race condition in Style Manager)
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? All browsers (Chrome, Safari, Firefox, Edg...
Issue #4323
BUG: Performance issue while dragging component to canvas when you have 2k component on canvas
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Google Chrome Version 101.0.4951.41 (Officia...
Issue #6324
BUG: sorter.setDragHelper is not a function on block drag
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? 131.0.6778.86Reproducible demo link https://...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.