#2110July 1, 2019by adamwpe1 answer
I need to limit certain Dom Components to one, because it would cause issues when the page is published - but I can't seem to find a way to delete the component within its own init(). Is there a better way, as it doesn't seem healthy to delete someone before it's fully created. Thanks
artf
It would make sense to move such logic to a parent component
#2109July 1, 2019by inventorbit3 answers
Thanks for providing the amazing framework and making it opensource. I'm looking to use Tailwind with GrapesJS, unfortunately grapesjs replaces "/" with "-" in the selector. Is it possible to override this? When I try to drag and drop responsive columns in canvas It replaces them to: How can I fix this issue? Please h...
artf
#1703 waiting for a help 😬
gavinhewitt
Thanks for providing the amazing framework and making it opensource. I'm looking to use Tailwind with GrapesJS, unfortunately grapesjs replaces "/" with "-" in the selector. Is it possible to override this?When I try to drag and drop respo...
chrisreedtech
What's your progress on making grapes work with Tailwind @inventorbit? Would love to see! @artf , I'm also curious if there is any progress on this or an available work around? Thanks for your time developing grapes!
#2107June 29, 2019by alikabeer321 answer
Since I started using the gradient plugin, the background image are in the following form: background-image: -webkit-linear-gradient(path/to/image.png); What should I do?
artf
There is already an issue opened regarding the gradient plugin #2068
#2106June 29, 2019by alialrabi3 answers
Hi artf, i make traits for specific component ,when i saved this component as a json and load again in editor the traits were load correctly and there is no proplem , when i update version of grapesjs traits appear only in first time , when load component again default trait was exist , how can i load traits again , a...
artf
@alialrabi How do you define traits? Inside blocks or custom components?
alialrabi
@artf i have created traits in custom component like this domComps.addType('assetType', { model: dModel.extend( { init() { this.listenTo(this, 'change:type', this.doStuff); }, doStuff() { }, defaults: Object.assign({}, dModel.prototype.def...
artf
@alialrabi you're defining your component with a name assetType but then in isComponent the type is asset
#2105June 28, 2019by wldyslw1 answer
Changing border-bottom-left-radius prop changes bottom right radius, and vise versa. Reproducing: Go to https://jsfiddle.net/szLp8h4nAdd, for instance, any imageTry to change border-bottom-left-radius prop in Decorations section Playing around config didn't help much, the best one fixes naming problem but reorder cont...
artf
Correct, the current default order is wrong but as the composite type follows the CSS order of the border-radius property the result will be exactly like the one achieved by you. In case you need to change the ordering of composite propert...
#2104June 28, 2019by georgikolev71 answer
Hey, I'm searching for the right way of loading template, generated by GrapesJS, but nothing is loading. Can someone please check, maybe format is not ok. https://api.myjson.com/bins/14o5yz There is no error message, just empty editor. Data is saved in the database with the following code The type of the columns is TE...
georgikolev7
Issue was caused by invalid JSON data inside "gjs-components" on saving, which breaks the loading later.
#2103June 27, 2019by imanubhardwaj3 answers
This is how I've created a custom component: This is my custom block: The thing is that I have wrapped the image tag inside <a> tag when it is rendered to canvas. When I click on the element and try to drag it, only <img> tag gets dragged and <a> remains on it's original place. Live demo
artf
With this you're still letting the view capturing your click events, so fix it:
artf
Well, I see 2 different solutions for this case:Easy and fast, make the custom-video component not draggable, so you have to drag the parent to move it. The tiny downside is more from UX side, you force users to select the parent.More soli...
imanubhardwaj
Thanks @artf but a new problem is arising now, when I drag the custom-video-wrapper component across the canvas, custom-video isn't dragged with it, only the <a> tag is dragged. Live Demo
#2102June 27, 2019by Amir28281 answer
Hello All, My question this time is, I added a new view which contains an image gallery and I would like to make it act like any other view. to be specific:change to active on click and show content of view while active.while other views are active hide my views content and change the button Css to not active. so far...
Amir2828
I dont know if there is a proper way to do it. I eventually managed to create this such a behavior by plain JS.
#2101June 26, 2019by prabha-9123 answers
https://github.com/artf/grapesjs/issues/906#issuecomment-381403858 I need to remove the html content from editor.getSelected(). Now I'm using, While I use selectedContent.set('content', ''); it remove all the inner html. But didn't remove the parent tag. For example, Before: <h2 id="it4a"><p>Sample Update Check Done</...
afdallah
Have you seen this #1077 answer by @artf I think it's suited with your case.
prabha-912
Yeah I tried @afdallah, It returns indexOf undefined. Let me try again. Thanks for your response :)
prabha-912
Hi @afdallah @artf I tried the above concept. It works fine in first time. While I try to update second time, it didn't work.
#2100June 26, 2019by fmr4111 answer
is it possible to change the class style (like color: white to color: red) in the trait, I create a new type, I want to change the style in onChange event. I have tried using setcustomparsercss but it doesn't work, Thanks
artf
I think you're looking for this: https://grapesjs.com/docs/api/css_composer.html#setrule eg. editor.CssComposer.setRule('.my-class', { color: 'red' });