GrapesJS Issues

3,464 parsed GitHub issues โ€” 370 solved ยท 90 open. Search, filter and explore battle-tested answers.

569 issues found

๐Ÿ” canvas
#2800May 25, 2020by meyerco3 answers
0 reactions

[Bug] when removing a tooltip its css is not removed

DescriptionThe bug is reproduced on the current demo Expected behavior When a tooltip is removed its css is removed What happens instead ? When a tooltip is removed its css is not removed Steps to reproduce on the demo Clear the canvas Drag a tooltip Remove the tooltipClick on Import button on top toolbar , the toolti...

artf

Yeah, I think you're right, probably replacing with might fix the issue, would you like to check and create a PR? :)

meyerco

@artf Maybe this code to keep the code generic ?

artf

@meyerco ๐Ÿ˜… yeah sure, sorry, it was a copy-paste from my try

#2799May 24, 2020by dintifla3 answers
0 reactions

[Questions] Ordering of selector with id and class selectors, space after id-selector

I am currently working on a web application for which we integrate this project as GUI editor to customize the environments. Our GUI components are loaded and parsed from the database. We can identify e.g. a button, data grid, etc. by an ID (e.g. 17190fbd-13d6-430f-bb32-1a09d2151a77). These components are then built f...

dintifla

a short update: I managed to get the the selectors in the right order when using selectors.unshift(idSelector) instead of selectors.add(idSelector) in above sample. Now i still have the issue with the missing space between the id- and the...

artf

Hi @dintifla SelectorManager is not meant to work like that (you can only have a mix of classes .class1.class2 but not with IDs), but honestly I don't understand what is your goal of using the SelectorManager at all. If you need to query a...

dintifla

Hi @artf Thanks for your reply. In the end it is not just about querying a component, but generate the CSS for it. I don't need the HTML since my application is designed in a rich client application, stored in an abstract representation in...

#2796May 22, 2020by vinceumo3 answers
2 reactions

CSS get removed when project init

Hi, I'm trying to import utility classes into grapes js. My issue is that grapes remove them if they are not use by an element in the canvas. I'm building a custom panel to link to my CSS variables (CSS custom properties) to manage this classes in grapes. How can I import my CSS and keep all the classes? I have create...

Ju99ernaut

grapesJS does not deal with css directly it first parses it into a CSSOM and uses that in the editor so a class will not show up in the code preview unless there is a component in the editor canvas using it. Your classes will be imported d...

Ju99ernaut

You could load the stylesheet externally during init and remove it from the index.html altogether You can also check the SelectorManager and CssComposer api reference

vinceumo

Thanks @Ju99ernaut, do you know if there is anyway to add some css and make it available in the canvas and as well have it in the export?

#2790May 19, 2020by motazad3 answers
3 reactions

[BUG] Devices not working in Version 0.16.12

@artf When I click on the devices(tablet, mobile), the size of the canvas is not updated But it Worked in Version 0.15.x and lower.

cdespinosaagmx

I have the same issue

kuhelbeher

I had the same issue after grapejs update. In my case it turned out that I was using old version of css file: https://unpkg.com/[email protected]/dist/css/grapes.min.css I updated it to use version as grapesjs and it solved my problem. Try...

alitorki2651

I have the same issue @artf

#2778May 15, 2020by ashishtyd2 answers
0 reactions

BUGS - Cannot read property 'querySelector' of null at r.getBody

Hi I was trying to use grapesjs on visualsource pages. Following is the init function - initEditor: function(){ var self = this; this.editor = grapesjs.init({ container: '#gjs', fromElement: true, height: '500px', width: 'auto', storageManager: false, panels: { defaults: [] }, blockManager: { appendTo: '#blocks', bloc...

artf

Create a reproducible demo please

no-response[bot]

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take ac...

#2774May 14, 2020by vinceumo1 answer
0 reactions

mediaCondition: "min-width" breakpoints not applying the correct style in canvas

Hi, I'm having some issue with mobile first approach. The canvas render the wrong style when setting different styles at multiple breakpoints. But the code generated is good, this issue only happen in the canvas. https://codesandbox.io/s/xenodochial-shockley-s02lp?file=/index.js:496-524Are you using the latest release...

artf

We should apply the same logic from https://github.com/artf/grapesjs/blob/201e1f9a61783080f7be885e9e0be9a40ecc16cc/src/codemanager/model/CssGenerator.js#L151-L162 here https://github.com/artf/grapesjs/blob/201e1f9a61783080f7be885e9e0be9a40...

#2773May 14, 2020by Light08151 answer
0 reactions

[BUG] (type: video) html5 always src of previous provider

Minor bug: When switching video type component to html5 provider it always takes the src of the previous provider. Instead I would expect it to be cleared. This also has another side effect since it seems (without checking code) that you set the provider depending of the src. This is especially annoying when you save...

artf

It should be fixed in the next release, thanks for the report

#2772May 13, 2020by Mohsen-Khakbiz1 answer
0 reactions

[Question]: loading scripts/css to the canvas depending on traits

hey there. first of all thanks for this sweet lovely tool. what I need is to load js or css files to the canvas depending on traits. let's say I have a button with an option for making it triggering a lightbox. now what I need is to only load the lightbox plugin's files only when this checkbox is checked. I couldn't m...

artf

When you use canvas: { scripts: [], styles: [] } it appends only those files to the canvas of the editor, so you won't see them in your final code (editor.getHtml()). There is no kind of global list but you still can tell the component to...

#2768May 12, 2020by kuhelbeher1 answer
1 reactions

[QUESTION] Can I add listener when user drag element on the canvas?

Hello, GrapesJS has bunch of events which could be listened with editor.on. One of them is canvas:drop. But it triggers only when I drop element which hasn't been on canvas yet. But I want to listen when user drops some component which already existed on canvas. Can I achiive this?

cartifon

Hi @kuhelbeher, in the version 16.2 they added that option, you can take a look here: https://github.com/artf/grapesjs/releases/tag/v0.16.2

#2764May 11, 2020by lofczNo answers
0 reactions

[QUESTION] block with content -> script after loading via storageManager

I have a component and a block defined inside my plugin. The block relies on fetching some data via AJAX and then re-rendering itself. When I d&d block to the editor canvas all works nice. But once I load the stored data, script is not executed. It can be seen in the image that component type is saved and loaded corre...