Hey @artf , is there a possibility to restrict the drop and drag functionality to elements classList containing some class or classes instead matching it? Thank you in advance! :)
artf
You could make use of this special attribute selectors div[class~="some-class"], [class~="some-other-class"]~= contains word*= contains^= starts with$= ends with
lock[bot]
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hello Grapejs Team, We've been working on Multi-page Website Builder. For each project there will be multiple html pages with single common "style.css" page. I am lazy loading each page with the following function - for handling multiple page loads The above page loads the page properly however, if page is empty or di...
cjpollard
This should work. `var editor = grapesjs.init({ keepUnusedStyles: true, ... });`
artf
@inventorbit next time, if someone solves your issue, close it
inventorbit
@cjpollard Thank you very much :) It's working. You saved my time...
Hi! Im trying to replace selected text with a code (random code). It's works, i can see the code, but when i do editor.getHtml() not. If i deselect the component (selecting another one) the change takes effect. Thanks!
artf
The content of the model is actually updated once you blur from the editable component, so when you call getHtml it's just not yet there
lock[bot]
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
WARNING READ and FOLLOW next 5 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/grapesjs/blob/master/CONTRIBUTING.mdUse the GitHub Issues EXCLUSIVELY for BUGS, FEATURE REQUESTS or QUESTIONS. Prefix the title of the issue with its context, eg. [Bug]: ....Do a quick...
lock[bot]
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hello, with the following code we are able to indicate if it's possible to drop other component(blocks) inside that particular component...: We are looking to indicate if it's possible to drop other components only for specific blocks. For example: A. Container Block - > we want to drop only columns B. Column Block -...
artf
From the https://github.com/artf/grapesjs/releases/tag/v0.14.17 you get data-gjs-type on all rendered components, therefore you can do something like this: droppable: '[data-gjs-type="column"], [data-gjs-type="other"]',
ploutos27
Thank you! :)
lock[bot]
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hi @artf I don't know if it is possible to remove an attribute from a component. In our project I'm injecting a custom attribute from a custom trait that I created but there is an option to unselect this attribute so I would like to remove from the component. I couldn't find the functionality on your code. Thanks in a...
artf
alemenciones
@artf hi man!, can you say me some alternative to remove attributes?
lock[bot]
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
@artf When I load the html content, this is including in all the components a random identifier that in your examples "Websites" and "Newsletter" I don't see them. So How I can force to keep my stylesheet and don't use random identifiers in all the components? I'm asking you this question because if I change the ident...
jvillena
@artf I've just fixed I was including the variable avoidInlineStyle: true, and it has to be avoidInlineStyle: 0
lock[bot]
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
@artf How can we disable editing in the preview mode and re-enable it when preview mode off. I want to remove editor and hide toolbar in the preview mode so that user can only view the changes and can not edit it also all the editable option should be come when user stop the preview mode.
jvillena
You can use: editor.stopCommand('sw-visibility'); editor.runCommand('sw-visibility');
YashPrince
@jvillena I have used this code but it is not working. editor.on('run:preview', () => { editor.stopCommand('sw-visibility'); }); editor.on('stop:preview', () => editor.runCommand('sw-visibility'); });
ghost
Hi Artur ( @artf ), I need to add save and publish button so is there any plugin available or do i need to hardcoded. Can you please help me.
The bug is reproducible on GrapesJs demo page. Steps to reproduce:Drag&Drop or select an Image component.Click delete icon from the toolbar. Result: nothing happens, as ed.Canvas.hasFocus() (file commands/view/ComponentDelete.js) returns false.Select any other componentSelect image again and try to delete it. Result:...
artf
Thanks Maryia, it should be actually fixed with the latest version https://github.com/artf/grapesjs/releases/tag/v0.14.25 (same as #1298)
lock[bot]
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hello had an issue using the data-tab attribute with my elements. We were creating a tab that made use of the attribute allowing it to swap between the contents, and when rendered onto the page the data-tab attributes are changed from their original value to a 1. This change then returns an error saying that this isn'...
artf
Hi @Moikapy, can you provide a minimal live demo of the issue, please?
Moikapy
Example Video: https://youtu.be/0cD3fzWdnHk Another thing I'm trying to figure out is how to keep GrapesJS from stripping the data-gjs-type attributes as well wen using the setComponent Function.
artf
You're using incorrectly the template. You should place attributes like data-tab and data-tab-container without assigning any value, those are used internally by JS to understand where pieces are placed