grapesjs-custom-code work fine with script tag until GrapesJS 0.16.27, after this version, no script content is executed. βοΈ Editor init() option : allowScripts: 1 βοΈ Plugin import : https://github.com/artf/grapesjs-custom-code/issues/11#issuecomment-724512902 Is it related to https://github.com/artf/grapesjs/issues/3...
nithinpillalamarri123
hi very thanks for u r replay... yes exactly , after you are replay i tried with 0.16.27 custom blocks script is working as expected but in above versions than 0.16.27 while drag and drop custom block script executing as expected but after...
artf
Hi @bgrand-ch probably you're talking about a fixed bug π Main reasons why you should not let execute a random script from a user:Self-XSSWe can't control the script if we execute it inside the editor, so, for instance, the user paste thi...
GJSBlock
Thanks for reporting this, @bgrand-ch. Great suggestion about grapesjs-custom-code doesn't execute <script> from GrapesJS 0.16.30 and up! While this specific feature isn't yet in the core API, there are several ways to achieve similar beha...
kindly any one help me to get out of this issue editor.setComponents(html text ); not working the script as expected after loading from saved template html while drag and drop its working after saving and again loading that html with edito...
artf
You can't load the generated HTML code back to the editor, read the documentation on how to correctly store and load templates https://grapesjs.com/docs/modules/Storage.html
GJSBlock
Thanks for reporting this, @nithinpillalamarri123. Thanks for sharing your report about grapes js version v0.16.34 giving unexpected script code after loading saved html. To help the team investigate and prioritize this: Please provide: A...
Version: 0.16.27 to latest Are you able to reproduce the bug from the demo? Yes [ X] Yes [ ] No What is the expected behavior? insert text block inside another text block Describe the bug detailed when adding new block, or even when creating a new custom type, the "textable attribute is not working as expected and as...
artf
Duplicate of #2771
GJSBlock
Thanks for reporting this, @hanna404. The issue with Textable attribute not working and causing exceptions appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DOM mo...
Version: 0.16.34 What is the expected behavior? When the editor is initialized, no element is selected, so the style manager should say "Select an element before using Style Manager" like it does when not using "appendTo" in the editor configuration. What is the current behavior? When using "appendTo" in the editor co...
mosh-tudor
I used this code to solve it:
Nielsticot
This is not what I want, my issue is before any element is selected so before the event "component:selected" is trigerred. I temporarily fixed it by selecting an element on editor load but it is not what I really want
artf
If you're using the StyleManager in a custom element you have to handle that state on your own.
We have a use case where we want to insert charts dynamically using Highcharts Editor. I have created a component, which on drag and drop, opens a modal based and based on user's selection, returns a SVG image. I am wondering how can I add it to the model's body. Right now I am using innerHTML to insert but the getHTM...
artf
You don't need components with JS in this case (in your final code you don't execute any JS), is enough for you something like this:
harsh201
Sorry for spamming. I was not able to upload usecase video from my work laptop. https://user-images.githubusercontent.com/2502711/106098322-d39c7b80-615e-11eb-8569-cf76ffc7fcc7.mov
harsh201
@artf Any help here will be appreciated. I went through the docs again and nothing stands out, which I could be missing.
I write html strings as blocks, and need to introduce a lot of external scripts and styles, but I tried all the methods, when I drag the block to the canvas, the script does not take effect, but styles can be loaded,I hope to get helpγLoad by appendchildinit load by canvas:{scripts:[...]} who can help me?
harsh201
@sizhousama I am loading scripts/stylesheets via canvas while initializing grapesjs editor and it works for me. More details can be found here. Hope it helps!
sizhousama
The console shows loaded
GJSBlock
Thanks for reporting this, @sizhousama. Great question about [Question]: How to load external javascript,i tried all methods,Useless. The recommended approach with StyleManager is to use the event-driven API. Start here: Check the GrapesJS...
Hi @artf I've added trait for wrapper this way. How can I perform the init function for the same Here is the code @artf Could you please help me? Thanks.
artf
You can use this option from components on init https://github.com/artf/grapesjs/blob/69e5ab2c1176e6fdeac1b058398cca55efe92df3/src/dom_components/config/config.js#L9 PS: stop annoying other people with your issues, please or I have to bloc...
So I have this issue... I have a 'text' box which is set to be full width but centres a name shortcode. When then generate a PDF and HTML page of this and expect the name to be central too. But as the name sizes can vary I've just realised with absolute positioning it is still taking the container size of of the value...
GJSBlock
Thanks for reporting this, @tonypartridge. Great question about Absolute mode and dynamic tags not positioned correctly.... The recommended approach with GrapesJS is to use the event-driven API. Start here: Check the GrapesJS documentation...
Hi @artf Is there any standard way to add a new toolbar on every component I've tried this way When I run this code on the browser console it's working as expected but when I placed this code In the component file this is not working when we define a new trait for all the components it's working fine. For Toolbar it's...
artf
Follow the issue template (version, live demo, etc.)
GJSBlock
Thanks for reporting this, @Abhisheknanda1344463. Great question about Set Toolbar on every Component. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific...
Hi, I have the following issue: I need an event type editor.on ("sorter: drag: end") which is thrown in all these cases: (detect what element and where I'm dropping it) 1- let it hear when you drag and drop an element from the blockManager and drop it on the canvas. 2- let it hear when you drag an already componentize...
bgrand-ch
Hello, For future questions or technical issues, which aren't bugs, GitHub's Discussions tab is the place to be. Don't forget to close this issue if it is resolved or write a new detailed message in Discussions -> Q&A category (and close t...
GJSBlock
Thanks for reporting this, @matiasmasciotta. Great question about DRAG AND DROP COMPONENTS:. The recommended approach with ProseMirror is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Lo...