GrapesJS Issues

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

569 issues found

🔍 canvas
#2419November 20, 2019by MartinPutz3 answers
1 reactions

[BUG] Absolute dragmode does not work on touch devices

Absolute dragmode (with grapesjs touch plugin) does not work on touch devices. GrapesJS version:0.15.8 Expected behavior: The user should be able to move components using drag and drop on touch screens as well. Current behavior: The user can drag and drop a block just fine. If the user wants to move the dropped compon...

wfcheng

This may or may not be related. I noticed with grapejs v0.16.34 on OSX Safari, the event argument inside onStart() function in src/commands/view/ComponentDrag.js is undefined when I drag a block onto the canvas, which can be reproduced wit...

pradeeshattlee

Hey @MartinPutz The asset manager doesn't pop up on the iPad, desktop on touch devices- chrome, firefox, and safari. And the editor canvas scroll doesn't work on the iPhone. What am I missing? Thanks in advance.

MartinPutz

Hey @pradeeshattlee This issue is not really related to the asset manager, but moving the components around, once they are rendered. I rarely use the asset manager, but as I recall it was working just fine on iPad as well. If I were you I...

#2418November 17, 2019by frankpagan1 answer
0 reactions

Is there an api or function to insert a value in a data-attribute in the canvas?

Hey Grapes Community! I created a custom trait select field that fetches options from our db for <a> components... when <a>(link) is clicked in canvas, component settings displays and our select field is rendered... I am looking for a solution to pass the selected value from our custom select field to the canvas. And...

artf

Hi @CoCreator-Frank I think the Trait docs page has already the answer to your questions (especially when we explain how to define a custom one). Here, for example, when you change the slider the value is passed to the component via onEven...

#2403November 12, 2019by varadero3 answers
0 reactions

editor.load possibly causes memory leak

How to reproduce:Naviagate to https://grapesjs.com/demo.htmlOpen browser console (Chrome) and type the following: setInterval(() => editor.load(), 1000) and press EnterGo to "Memory" tab (Chrome) and look at the memory usage What happens: The memory is constantly increasing. If you open Chrome's "Performance monitor"...

varadero

This is important. If not fixed, it makes GrapesJS dangerous to use especially in SPA applications.

artf

I'll check it out, but any help is welcome

diazemiliano

I'm having the same issue here. Even after destroy the editor, the issue remains.

#2401November 12, 2019by Indhumathi20162 answers
6 reactions

How to check a component or element is present in canvas or not

I have been trying to enable a checkbox in trait on load, when a element is present in canvas but unfortunately i don't know how to check the element is present or not, i'm trying the following code in onRender() method const canvasElement = editor.DomComponents.getWrapper(); let isGdprEnabled = false; if (canvasEleme...

pouyamiralayi

Hi @Indhumathi2016 you can use find method: cheers!

Indhumathi2016

@pouyamiralayi It's working fine when i do like this editor.on('load', () => { const wrapper = editor.getWrapper() const el = wrapper.find('#gist-gdpr')[0] }); Thanks

#2399November 12, 2019by imranali20453 answers
0 reactions

SVG Component Not Draggable

Hi, I am using grapesjs in angular 7.What I want to achieve when ever canvas drop method called I add svg component in canvas.I have add svg component on canvas drop method.But its not draggable. I attach my code and video for better understand.Thanks @artf if you help me. <code>const domComponents = this._editor.DomC...

imranali2045

@artf please see that It is very important for me to solve this problem.thanks

artf

Unfortunately, HTML5 drag and drop API doesn’t work on SVG elements, so if you need to support it you have to wrap your SVG components (eg. in a div element)

imranali2045

@artf ok thanks

#2393November 8, 2019by troncoso3 answers
2 reactions

[Question] Determine why 'block:drag' event won't fire

My company uses GWT (Google Web Toolkit) to develop some web applications. We have a stand alone GWT component library for our re-usable components. I created a component that wraps grapesjs and it works great. However, when I import this library into an actual project and add the grapes editor to a screen, everything...

troncoso

Thank you for that information. However, in my case this was not working due to this in the index.html: Removing these attributes resolved my issue.

pouyamiralayi

@Troncoso can you provide a fiddle to reproduce this?

troncoso

Well, no, not likely. Not only is GWT a Java framework, but I have grapesjs working in one GWT project but not another. I imagine this will likely get closed, but I was hoping that posting it as a question might net me some suggestions. Th...

#2389November 8, 2019by Khan-Uzair2 answers
0 reactions

Angular with Grapesjs

Hi I want to integrate Grapesjs into my angular application. Suppose I have a custom dropdown component (containing .ts, .html and .scss files) as shown shown below: CustomDropdown.html---------------------------------- <div class="cust-dropwodn-container"> <span>Some header</span> <select ngIf="shouldDropdownBePresen...

Khan-Uzair

Any updates @artf?

artf

No @Khan-Uzair by default GrapesJS doesn't read any framework related components... please read more about GrapesJS components here

#2388November 7, 2019by asieraduriz3 answers
2 reactions

[Question] - How to import styles from <link> to be rendered when dragging block to canvas

My situation: I'm slowly importing some of my custom made UI components in ReactJS to GrapesJS. Now, I am able to render the component properly by integrating it with Backbone. But my question is, can I use <link tags to download my own custom styles, so that I can see them properly within the canvas? I have tried doi...

asieraduriz

Hello @pouyamiralayi Thanks for the quick answer. However, this would seem that won't be sufficient, since what I'm looking for is a way to see my rendered component with the styles that I want, but also, if I export the project, to includ...

artf

Just init the editor with your <link> inside the template, it will be loaded in the canvas and you will be able to see it in your export code

pouyamiralayi

Hi @fasaas you can inject your global styles this way: the same goes for your custom scripts. more on this here cheers!

#2372November 4, 2019by emilsedgh3 answers
3 reactions

Dragging from toolbar can be off (dragMode)

Here is a working demo of the issue Steps to reproduce:Select a componentTry dragging it from the toolbar You can see that immediately the component jumps to the left. Although it works fine if you try dragging the component by itself (and not using toolbar) This only happens if Grapesjs is loaded from a with margin a...

emilsedgh

Oh, I tried to find it before reporting but I couldn't. Thanks. I'll close this one then.

pouyamiralayi

@emilsedgh there is an open discussion about this here

alemenciones

this's fixed in the last release right? I need a solution when i drag outside of iframe in mobile devices