GrapesJS Issues

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

829 issues found

🔍 question
#1828February 25, 2019by SeongwoonHong2 answers
0 reactions

[Question] Add an additional text box for image upload modal?

Hi Artur, I'm wondering if that's possible to add some input boxes for image upload modal? I'd like to add some boxes in the red area in the screenshot above. Those boxes is intended for adding href for the image

artf

You can intercept the asset open command and then manipulate the DOM for your needs

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.

#1827February 25, 2019by sanjib002 answers
0 reactions

[QUESTION] How to add a button in the section (block) on hover?

Hello @artf, You are doing great work. I tried to add a button in the section (block) on mouseover. Can you please help me to add or show "Add Column" button on hover? I was following the issue #1789

artf

@sanjib00 I think this demo https://jsfiddle.net/xcv07abt/ is enough to understand what to do next

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.

#1826February 23, 2019by SeongwoonHong3 answers
5 reactions

[Question] How to add link to an image?

Hi Artur, How to add a link to this image? If i need to create a custom component, please give me some example code Artur.. Thank you so much

Shah-ali

Drag a link block, Then drag an image block inside the link block.

artf

@luvcharan you have to use "Link Block", not "Link"

luvcharan

Hi, Add link (href) to image in grapesjs . First we add image in grapesjs and then add link to that image, its shows " Link " text next to that image, but i was unable to add link to that image. here i am adding screenshot below, can you p...

#1823February 21, 2019by abozhinov3 answers
0 reactions

[QUESTIONS] How to set different styles on one element for each device. (responsive)

@arthuralmeidap can you tell guide me how to set style different style for each device. I use the mobile-first strategy. For example to set a different background on mobile and desktop devices. mediaCondition: 'min-width', var deviceManagerConfig = { devices: [ { name: 'Desktop', width: '', widthMedia:'768px' }, { nam...

umerrinayat

@abozhinov I'm facing the same issue. If you solved the issue? Can you share it here. Thanks

theSC0RP

@abozhinov @umerrinayat I am facing the same issue. If you have solved it, can you please share it here?

abozhinov

No I didn’t. Still search for solution.

#1822February 21, 2019by arthuralmeidap3 answers
1 reactions

[QUESTION] - Add style sector for specific Css rule

Hey @artf , COuld you give your help on this one? I want to disable the user to able to select the wrapper block (body) but I still want to let them style it. So I was thinking to add a custom sector that would be displayed for all blocks but, the styles applied in that sector would be applied specifically into a css...

arthuralmeidap

There are several drawbacks to my approach but, since on this app we are not using the Selectors for the Style Manager, look what I did; I added a custom target property to my new sector. I started to listen the change:open for each sector...

arthuralmeidap

Just an example: The user has selected a Text Block. On the Style Manager panel, would display as it is today. The css selectors applied to it and the sections like General or Decorations to style it and besides that would have some Global...

artf

Yeah I think it's possible, you should append a new sector with your inputs manually on editor load and on input change update the wrapper style editor.getWrapper().addStyle({ color: yourInputEl.value }) or if you need some specific CSS ru...

#1821February 21, 2019by abozhinov3 answers
3 reactions

[QUESTIONS] How to apply the style changes to the ID instead of the class?

Hi, I have two elements with the same classes. I want to apply style changes with style manager to one of these two elements. I add ID but the style applies to the class not to the ID. What can I do?

arthuralmeidap

At the Style Manager painel, you have a way to select/unselect to which css selectors (classes or id) you want to apply the styling. Click on a block and open the Style Manager panel. You will see all selectors applied to that block.

abozhinov

Thanks ... The UI is not user-friendly.

abozhinov

@artf I think the problem is in the ICON. I edit the sources code and replace it with SVG also rewrite the style. Do I have an option to replace the TEMPLATE for each section without editing the source code? <img width="1132" alt="screensh...

#1819February 20, 2019by sushiljic2 answers
0 reactions

[Question]: Block content attributes (ngModel in my case) forced to lowercase

I am trying to use angular directive. On any of the block content, for example bm.add('radio-block',{ label:'Basic Form Element', category: c.category, content: '<input type="text" name="username" id="username" ngModel> ' }) on export ngModel will be ngmodel So what will be possible solution so that it display ngModel...

artf

ngModel is converted in ngmodel by the browser (HTML5 doesn't accept uppercase for attributes) You can skip the parser by passing a component object

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.

#1818February 20, 2019by mcrodrig2 answers
2 reactions

[Question]: Making grapesjs working with angular7 and material

I'm trying to integrate the library with Angular7, but got problem when moving container <div id="gjs"></div>into the material component (stepper) in this case. I put my code in https://stackblitz.com/edit/angular-qa6gqz (error with grapesjs doesn't happen in my local environment). Can you helkp?

mcrodrig

For future reference: Problem was related to executing the grapesjs.init call before the html was rendered and the <div> inside the mat-step was not available.

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.

#1814February 19, 2019by ateebahmed2 answers
0 reactions

[Question]: How to fire event which triggers component:selected with my component

I want to select my component whenever it is dragged from blocks to canvas and rendered, I have tried with registering events on component:add, component:mount and calling editor.select(component), passing the component I get from callback, but it is not properly initialize or has properties missing, like its type is...

artf

https://github.com/artf/grapesjs/issues/1813#issuecomment-466408328

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.

#1813February 19, 2019by ateebahmed3 answers
0 reactions

[Question]: Can't get correct component from editor.on events callback

I am using editor's events to get component after some action like component:add, block:drag:stop, but in both events I can't get my component that I dragged on canvas. when I call component.is('my-component-type'), it gives false, I need to perform actions based on its type, which I can't when I get that from event's...

artf

You're doing something wrong, works as expected here https://jsfiddle.net/nfkha41p/ Next time, create a reproducible demo first, then open an issue...

ateebahmed

Actually I can't produce it with built-in components but I'm using a custom component which extends default text component, will paste the code as I could not find which property to set to get the component type, although I had set type: '...

naveen-15697

You're doing something wrong, works as expected here https://jsfiddle.net/nfkha41p/Next time, create a reproducible demo first, then open an issue... @artf Here, when I drag a first component, I get three alerts. But I need only the parent...