GrapesJS Issues

3,464 parsed GitHub issues β€” 370 solved Β· 90 open. Search, filter and explore battle-tested answers.

466 issues found

πŸ” components
#3559Jun 22, 2021by iabhiyaan3 answers
0 reactions

Page.getMainComponent().view gives undefined when page is selected

Hello @artf, I want to get the HTML Element of selected page. But it returns undefined when using following code:

artf

Hi @iabhiyaan, when page:select triggers, iframes inside the canvas are not yet loaded, so you just need to wait once they are loaded before accessing its DOM.

iabhiyaan

Thankyou @artf.

GJSBlock

Thanks for reporting this, @iabhiyaan. Thanks for sharing your report about page.getMainComponent().view gives undefined when page is selected. To help the team investigate and prioritize this: Please provide: A minimal reproducible exampl...

#3557Jun 22, 2021by acip4 answers
0 reactions

Upgrade - how to update old templates to the newest version?

I have some templates that were generated with v0.14.5. How can I "upgrade" them to the latest version? They have classes attached and I see that the newest version doesn't add classes to the elements anymore. Context: we use bespoke components and some defaults (e.g. draggable, resizable etc., style) have been change...

artf

They have classes attached and I see that the newest version doesn't add classes to the elements anymore. I'm not sure what you're talking about, classes should be imported as before.Context: we use bespoke components and some defaults (e....

acip

Hey, thanks for the quick response. Here is the template generated by v0.14.5 https://jsonblob.com/535ae06f-d4f6-11eb-8bc1-415e99da64cb This is how it looks https://ibb.co/Zz8qg2J We've changed some custom components' default attributes an...

acip

I've setup old vs new version for an existing template: https://grapesjs-templates-upgrade.ciprianamariei.repl.co/0.14.5-old-template.html https://grapesjs-templates-upgrade.ciprianamariei.repl.co/0.16.45-old-template.html

#3548Jun 18, 2021by tannguyen972 answers
0 reactions

Cann't copy with "control + C" when elements have attribute tabindex = -1

Hi everyone! i have a problem with custom component. i was created a modal component have attribute tabindex = -1 and i can't use key Ctrl + C to copy this component. Pls helps me. thanks very much !!!

artf

Just remove that attribute in your component view (eg. in onRender method) in that way you'll still get the attribute in your final HTML

GJSBlock

Thanks for reporting this, @tannguyen97. Thanks for sharing your report about cann't copy with "control + C" when elements have attribute tabindex = -1. To help the team investigate and prioritize this: Please provide: A minimal reproducib...

#3546Jun 16, 2021by ankx062 answers
0 reactions

How can I add the custom left toolbar for Image component similar to text

We want to add a custom toolbar to the image component to be shown at left side (similar to what we show for text component). Please let me know how can I do this. We want to add different custom toolbar for custom components too.

artf

Check the toolbar property in Components API reference and try to search for something related in Issues

GJSBlock

Thanks for reporting this, @ankx06. Great question about How can I add the custom left toolbar for Image component similar to text. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS doc...

#3541Jun 15, 2021by deiga3 answers
0 reactions

What is the idiomatic way to append and remove classes from components?

Hey there πŸ‘‹ Love the editor! We're using traits to modify what classes a component has, but that feels a bit hacky as you have to redeclare ALL classnames for each trait selection Here a simple example: Each trait option has to have all the classes defined, because otherwise it will remove any existing classes. This...

krishnaeverestengineering

@deiga we are doing something like this.

artf

I'd attach the trait to some component property instead of the class attribute, and based on the value I'd use properly removeClass and addClass

GJSBlock

Thanks for reporting this, @deiga. Great question about [QUESTION] What is the idiomatic way to append and remove classes from components?. The recommended approach with Components is to use the event-driven API. Start here: Check the Grap...

#3529Jun 10, 2021by tmrowe1231 answer
0 reactions

Trying to add onClick attribute to component

Hello, Fairly new to this great project but I am trying to change the display of a component onClick of another component after the component id is selected from the dropMenu. I'm having trouble trying to add an onClick attribute to the component after selection from a dropMenu trait. I can't seem to access the value...

GJSBlock

Thanks for reporting this, @tmrowe123. Thanks for sharing your report about Trying to add onClick attribute to component. To help the team investigate and prioritize this: Please provide: A minimal reproducible example (CodeSandbox/JSFiddl...

#3528Jun 10, 2021by krishnaeverestengineering2 answers
0 reactions

I wasn't able to unit test grapesjs components

Not sure exactly whats happening but this is what I am getting. Sometimes tests are passing and randomly tests are failing due to this. Any help please @artf <img width="1474" alt="Screenshot 2021-06-10 at 7 08 14 PM" src="https://user-images.githubusercontent.com/55732888/121535085-71faf080-ca1f-11eb-8e07-aeedf9ab746...

artf

Same as here https://github.com/artf/grapesjs/issues/3476#issuecomment-848074298

GJSBlock

Thanks for reporting this, @krishnaeverestengineering. Thanks for sharing your report about I wasn't able to unit test grapesjs components. To help the team investigate and prioritize this: Please provide: A minimal reproducible example (C...

#3524Jun 8, 2021by iteniel3 answers
0 reactions

Integrate select2 UI element into traits

I'm new to grapesJS ... Great tool.I have a few questions about traits. I followed this tutorial https://grapesjs.com/docs/modules/Traits.html#define-new-trait-type because I have to overwrite how href is generated. The example is great for me with few modifications. I I want to replace .... <select multiple="multiple...

artf

You can do this:

iteniel

@artf thanks Can you help with first part of the question I need something like onPostRender/afterRender to initialize the select2 component when the DOM is present somthing after createInput method

GJSBlock

Thanks for reporting this, @iteniel. Great question about [QUESTION]: Integrate select2 UI element into traits. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your...

#3512Jun 2, 2021by Palash-Mandal3 answers
1 reactions

Child elements not draggable ,droppable highlightable. also the CSS of all child elements not pushed in style section while develop a banner component in as plugin

Hello @artf , I am trying to develop a simple banner plugin which will be include a heading , subheading and link. and every element can be draggable ,droppable highlightable, but based on below code some portion of code not working. Please Help only banner class CSS pushed but another all not go in the CSS section --...

artf

In your model component definition, you're using content: config.template but it should be components: config.template

Palash-Mandal

Hello @artf , I have made the solution but there are some issue arise the component. the child component h2,h3 and link pushed for all other component. If I drop one column component those child element also pushed inside there. How Do I r...

GJSBlock

Thanks for reporting this, @Palash-Mandal. Great question about Child elements not draggable ,droppable highlightable. also the CSS of all child elements not pushed in style section while develop a banner component in as plugin. The recomm...

#3511Jun 2, 2021by moises-flowize2 answers
0 reactions

Command core:component-enter not working in all the cases

WARNING READ and FOLLOW next 3 steps, then REMOVE them before posting the issueFollow CONTRIBUTING Guidelines https://github.com/artf/grapesjs/blob/master/CONTRIBUTING.mdDo a quick SEARCH first, to see if someone else didn't open the same issueAll relative statements/questions have to be filled/answered, otherwise, th...

artf

Thanks @moises-flowize that will be fixed in the next release https://github.com/artf/grapesjs/commit/ac96298add119c4f4e000967ab3332f9ad711613

GJSBlock

Thanks for reporting this, @moises-flowize. The issue with Command core:component-enter not working in all the cases appears to be a race condition or state management timing problem. This typically happens when component lifecycle events...

Browse all topics