Hey @artf, I was trying toggle between using ids and classes for styling so I need to change the componentFirst attribute programmatically. But when I try to change the config, the behaviour doesn't change. This isn't working even in the demo. Steps to reproduce:Add two text blocksGive them the same class name.In the...
artf
You have to retrigger the selection after changing that option editor.trigger('component:toggled')
GJSBlock
Thanks for reporting this, @theSC0RP. Great question about How to programmatically change componentFirst?. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your speci...
Version: 0.17.4 How to reproduceSwitch to tablet or mobile modeHide the selected component by toggling the visibility icon of LayerSwitch to desktop mode. ResultThe visibility icon is still disabled while the hidden components is showing. ExpectedAfter switch to desktop the visibility icon is enabled.
artf
Thanks for the report @tranthanhhoa I'll fix it in the next release, but I think I'll keep the visibility change more like a global condition, so the hidden component won't be visible on all devices.
GJSBlock
Thanks for reporting this, @tranthanhhoa. Great question about Layer visibility does not work properly. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific...
Hi Guys, I am using grapesjs-blocks-bootstrap4 and I check how they component it's looks fine. But when you select block like container it targets the class instead of Unique ID. I was able to setup random ID using this model.set('attributes', { id: randomID() }); but still when you select the block it targets the cla...
Thanks for reporting this, @cedriclajato. Thanks for sharing your report about No Generated ID and No auto select ID. To help the team investigate and prioritize this: Please provide: A minimal reproducible example (CodeSandbox/JSFiddle) Y...
I have created a custom trait but the name of that trait will be dynamic which is unknown. The problem is that the current removeTrait() only works with name/id. But what if I want to remove all traits from the component with custom-trait. Ex: I create a trait 'my-custom-trait' and bind it to the component. component....
artf
You can use of the ID
GJSBlock
Thanks for reporting this, @vijayshukla30. Thanks for sharing your report about Remove custom trait by its type.. To help the team investigate and prioritize this: Please provide: A minimal reproducible example (CodeSandbox/JSFiddle) Your...
What are you trying to add to GrapesJS? Component should be able to mark themselves as dirty, triggering the onbeforeunload warning message. Describe your feature request detailed I have a (custom) text component where the user can enter arbitrary text. I'm storing the data on my server, and I want autosave. However,...
anlumo
I worked around this by completely disabling the onbeforeunload handling and rolling my own.
artf
The editor has editing property which changes any time RTE is enabled/disabled, so I guess, in your case, this should work
anlumo
Wouldn't this onbeforeunload handler be overwritten afterwards by the snippet I referenced above?
Is there any way to add new section after the selected component using grapesjs ?
artf
You can do it in this way:
GJSBlock
Thanks for reporting this, @iabhiyaan. Great question about FEAT: insertAdjacentHTML('afterend', '<section></section>') . Is there any api like this in grapesjs ?. The recommended approach with Components is to use the event-driven API. St...
Version: 0.17.4 Are you able to reproduce the bug from the demo?[ ] Yes[X] No What is the expected behavior?After inserting an iFrame that the src will be returned when using editor.getHTML()When loading a page that iframes will be recognized as iframe component and become editable again Describe the bug detailed Am a...
artf
I'll add iframe support in the next release
GJSBlock
Thanks for reporting this, @TheDude70. The issue with iframe does not save src / does not recognize iframes after load appears to be a race condition or state management timing problem. This typically happens when component lifecycle event...
Hello, right now grapesjs provides built in properties like margin, padding that allow user to change each property one by one (margin-top, margin-bottom, etc). It would be nice to have ability to change all these properties together. To have some lock button, for example, when it's enabled it will change all properti...
artf
Yeah, that would be cool, but unfortunately, GrapesJS doesn't have yet the proper UI module which could allow easily to build new UI components by reusing others, so StyleManager.addType is the only way but in that case, it's up to you bui...
GJSBlock
Thanks for reporting this, @kuhelbeher. Great suggestion about FEAT: Ability to change all margin, padding etc properties together! While this specific feature isn't yet in the core API, there are several ways to achieve similar behavior....
Consider a simple block: When dragged to canvas, this component can be selected and it's possible to modify its settings. Now, i'm doing this, to add the same input in a card: $(someElement).find(".card").html('<input type="text"/>'); The input is added successfully but doesn't behave as it did before. It can't be sel...
GJSBlock
Thanks for reporting this, @ahmedderkaoui. Great question about Element injected as HTML to canvas doesn't behave as a component. The recommended approach with StyleManager is to use the event-driven API. Start here: Check the GrapesJS doc...
Hello @artf , Many Many Thanks for previous help. I am fresher in development. Please help me with below I need a modal where I will get user input Like Block Name, Category, HTML, CSS, JS then click on save to store that as new block manager. Mean how to pass those data and store them as dragabe component I have made...
artf
Please follow the issue template
GJSBlock
Thanks for reporting this, @Palash-Mandal. Great question about *. The recommended approach with StyleManager is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event lis...