question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUESTION] Text component converted to Box after saving

See original GitHub issue

I have a custom component when dropped inside a Text component (I am using a custom text component that extends the original text component) after saving and reloading the HTML/CSS I am experiencing the same problem - the text component converts to a Box. I use a custom attribute, but no matter the attribute the type of the component converts from Text to Default. P.S.: The custom component becomes editable on double click.

Before saving:

<div data-gjs-type="text" data-highlightable="1" data-text-extended="Text">Insert <span data-gjs-type="custom-type" contenteditable="false" data-gjs-textable="true" >Custom comp test</span>your text here</div>

On loading already saved content:

<div data-gjs-type="default" data-highlightable="1" data-text-extended="Text">Insert <span data-gjs-type="custom-type" contenteditable="false" data-gjs-textable="true" >Custom comp test</span>your text here</div>

Related issues: https://github.com/artf/grapesjs/issues/761

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
inaLarcommented, Aug 22, 2019

@pouyamiralayi, yes, I have done exactly the same and it is working, but also I’ve managed to use tagName (div, p, … ) in the isComponent of an extended text component and this also works in my case. I will close the question now.

Thank you very much for all the inside!

Cheers

1reaction
inaLarcommented, Aug 22, 2019

Hi! This is very useful information - about accessing the model this way instead the DOM. I will explore it. I still don’t understand why the gjs-comp-selected class is stored in the innerHTML precisely when I drop the custom component inside a text component. Maybe this is just uncovered behavior.

Also I am exploring the option to remove the class attribute (gjs-comp-selected) from the custom component inside its model, onRender(). But still determining the parent from child model is a new territory for me 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to edit or format text in PDFs using Adobe Acrobat
In Acrobat, on the Edit menu, choose Preferences. The Preferences dialog box is displayed. · In the dialog box, click Content Editing under ......
Read more >
In React ES6, why does the input field lose focus after ...
I was using a key from a text field. Inside the same block; I had an input field to update the value of...
Read more >
Multiple Choice Question
The Select Box format displays answer choices in a list respondents can scroll through. Respondents can easily select multiple answer choices through several ......
Read more >
Word Options (Advanced)
Choose formatting, text, and image options. ... Save backup copies, automatically save changes to templates, or allow backup saves. Word 2013 save options....
Read more >
Quiz settings - MoodleDocs
Open the quiz: You can specify times when the quiz is accessible for people to make attempts. · Close the quiz: After the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found