Method setComponents() delete wrapper/body id and the style #5518
Unanswered
JoanCodinachUoc
asked this question in
Q&A
Replies: 1 comment
-
setComponents updates components inside the wrapper, so your inner body is simply skipped during the parsing. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
To load a document in grapesjs i use the setComponents function but if i style the wrapper/body (you can see the id id="i8sk" and the style #i8sk{background-color:#de9797;}) when i use the setComponents function the id and style dissapear.
Param of setComponents() :
<style>p{margin-top:0px !important;margin-right:0px !important;margin-bottom:0px !important;margin-left:0px !important;}*{box-sizing:border-box;}#iojf{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;}#ible{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;font-size:20px;}#i4i4{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;}#ia05{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;}#i8sk{background-color:#de9797;}</style><body id="i8sk"><div id="iojf">Insert your text herexczcxzc</div><div id="ia05">Insert your text herexczcxzc</div><div id="i4i4">Insert your text herexczcxzc</div><div id="ible">Insert your text here asdS AsS Asa</div></body>
Result of getHtml() :
<body><div id="iojf">Insert your text herexczcxzc</div><div id="ia05">Insert your text herexczcxzc</div><div id="i4i4">Insert your text herexczcxzc</div><div id="ible">Insert your text here asdS AsS Asa</div></body>
Result of getCss():
p{margin-top:0px !important;margin-right:0px !important;margin-bottom:0px !important;margin-left:0px !important;}*{box-sizing:border-box;}#iojf{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;}#ible{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;font-size:20px;}#i4i4{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;}#ia05{padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;}
As you can see the body style dissapear, any solution?
Beta Was this translation helpful? Give feedback.
All reactions