#1432September 17, 2018by JulyanoF3 answers
I created a Custom Block: and a Custom DomComponent: And a Custom Command (I found where error is happening): When I set the new link for child img, any block I add to editor, is adding twice, and when I select this duplicated block, both are selected and changed:
artf
@JulyanoF you should never do this editor.DomComponents.render() if you feel like you need that function, probably you're doing something wrong... then in your custom component, you don't set isComponent method, so please review this guide...
artf
I'm trying getting html of selected element (editor.getSelected().toHTML()), manipulating it and changing original content This is wrong... You should use Component's API, don't touch the view or even worse, its HTML. If you don't understa...
JulyanoF
@artf you are right. the problem is using render() function, that is duplicating the elements.. but, if I remove this function, the editor html didn't change.. it still showing old content and not the new. How can I avoid it? I will provid...
#1431September 17, 2018by mrajeshkrossark3 answers
I hosted my html content in cloud. Then trying to load the html content in the editor I found the error: "Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. If an...
cjpollard
You're pointing your storage manager to a website. You need endpoints that can handle the requests. https://grapesjs.com/docs/modules/Storage.html#setup-remote-storage
JulyanoF
> You're pointing your storage manager to a website. You need endpoints that can handle the requests. https://grapesjs.com/docs/modules/Storage.html#setup-remote-storageI tried with below endpoints that also shows errorstorageManager: {typ...
mrajeshkrossark
You're pointing your storage manager to a website. You need endpoints that can handle the requests. https://grapesjs.com/docs/modules/Storage.html#setup-remote-storage I tried with below endpoints that also shows error storageManager: { ty...
#1429September 15, 2018by iainheng3 answers
I have problem loading stored remote content into the editor when the JSON contains non empty gjs-components My JSON data looks like this which is very basic blockquote with a sentence of text Example response when calling my remote endpoint I am able to load the content if I set gjs-components: "" and it will load th...
artf
There is actually might be a bug, can you try to return gjs-components as a string (so try to json encode your array)
artf
Thanks @iainheng, for now, keep it like this until the next release (hope to push it the next week)
iainheng
@artf Thanks for your help. 😊 It is a bug indeed. I store the gjs-components as a string and it is working now. 🎉 This is the same data store as string
#1428September 15, 2018by peakrams3 answers
Hi, I'm wondering if there is the possibility to define properties for specific components. I mean, when I select the component Image I would like that in the style manager panel the section relative to the Typography is not shown; in the same way, when I select a Table component I would like to see in the style manag...
juanj
I'm not sure if this is the optimal way of doing it but you can listen to the event component:selected and if the component selected is the one you want you can add a new sector. Then you need to listen to the event component:deselected an...
artf
Actually, you can also rely on a few Component's properties made exactly for this purpose:stylable - True if it's possible to style the component. You can also indicate an array of CSS properties which is possible to style, eg. ['color', '...
artf
@peakrams the warning is actually there but the Github's Markdown doesn't let you apply custom styles to make it more visible ¯\\\(ツ)\/¯
#1427September 15, 2018by chiqui3d3 answers
I'm testing the editor on a particular template with Boostrap 4 using flex, but I realized that some paragraphs do not show the badge correctly, I'm going to put here the demo https://jsfiddle.net/kf5n9sdq/31/, I've given myself that if I delete the main image if you can select, but I do not really understand what hap...
juanj
It looks like it have something to do with the scroll. If you scroll, the blue selection box shows where the paragraph was at the start. I don't think it have anything to do with the image. Even if you delete the image and scroll you get t...
chiqui3d
Great observation mate, it was that, the problem came from the body that had the overflow: hidden; Thanks very much @juanj
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.
#1426September 14, 2018by YashPrince2 answers
@artf how can we set some configuration so that while importing html in editor it will not consider some element as text component and it should consider as inside text of the parent. eg.. <p> here is some example text.<span> Do not make it as text component </span> Example text 2 </p> I don't want to make span as tex...
artf
Extend the text component type and implement your logic in isComponent. If the element meets your conditions (you would probably check for inner elements) just return the object in this way
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.
#1425September 14, 2018by YashPrince2 answers
@Arif How can we validate the properties for the grapejs element like background color We have given an option for manual background entry as well as color picker . If user did not add valid css then style break and preview page is not working properly. Any help would be appreciated.
artf
There is no built-in functionality for such a thing but keep in mind that once you render the style manager, all the elements, even when not visible, are still reachable via DOM, so you can add your validation logic post render
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.
#1424September 14, 2018by mararn16183 answers
I have a custom component with a checkbox trait 'show-name'. When the trait value is 'true', the component renders in the view to the attribute show-name="true", whereas the model only has "show-name" and renders to "show-name" via getHtml(). How can I get a checkbox-trait to render to "show-name=true" via getHtml()?...
artf
@mararn1618 can you create a reproducible live demo of this issue, please?
mararn1618
Hi @artf, of course. I have extracted the relevant parts of my project and created a demo along with reproduction steps:Demo: https://www.secretbakery.io/grapesjs/issue1424.htmlList demo files: https://www.secretbakery.io/grapesjs/ Thanks...
mararn1618
I am right now using a workaround for this, so that my AngularJS directive - where this attribute shall be used - recalculates 'show-name' as if we had 'show-name="true"' in the link stage.Workaround AngularJS Directive
#1423September 13, 2018by jvillena2 answers
Hi @artf, Now I'm working on creating a breadcrumb similar to the LayerManager but I would like to know if already exists a method that I can tell it the dom element to be hovered when I'm over the breadcrumb item similar as you are doing on the LayerManager. Thanks
artf
Each component has a status property, so in your breadcrumb view you can listen to change:status on each component model. Look at how it's implemented in ComponentView and just re-used in Layers here ItemView. So you can basically do the s...
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.
#1422September 13, 2018by FrciSmrci2 answers
Hey @artf, as already mentioned in this closed ticket => I think that this specific enhancement broke the behaviour of properties without units, like Opacity. The slider behaves weirdly in this case, even on the GrapesJS demo. Thank you in advance.
artf
You're right, I think I should use parseFloat here, will be fixed in the next release
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.