GrapesJS Issues

Search parsed GitHub issues, see highlighted answers, and open the original discussion when needed.

3464 issues found

#1859March 5, 2019by MisterFK3 answers
0 reactions

Change an element type in editor

Hi, In my javascript i already create 2 components (type "A" and type "B) with their own traits. I create a context menu on both elements to switch (in the editor) the selected element from type "A" to type "B" and change the traits in consequence. I didn't found the way to change the type of an element already insert...

arthuralmeidap

Take a look here: https://grapesjs.com/docs/modules/Traits.html#add-traits-to-components It shows how to add/remove custom traits for existing types. It may help you

MisterFK

Thanks, but i don't want to change the type but i want to change the type of only one selected element... If i change the traits of component, all the others elements with this type will be changed and it's not the purpose.

artf

I didn't found the way to change the type of an element already insert in the editor. The solution will be the same in case you would like to change a <div> with an <img>... so you remove it and replace it with another component at the sam...

#1857March 5, 2019by WebEtSolutions1 answer
0 reactions

Protected class not used

Hi ! On your ClassTagView, you don't check the protected attribute before remove tag.

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.

#1856March 5, 2019by fmr4112 answers
0 reactions

[Questions] getHtml grapesjs web builder

I have a problem in getHtml. I add an icon in the button, in the web the icon is visible, and when in the inspect element there is an icon object, but when in getHtml it uses the editor.getHtml() function, the icon disappears. Object icon result editor.getHtml() :

artf

getHtml is based on the component model data, you probably just changing its view data (eg. this.$el.append('<i class="fa ...')). Read carefully this part https://grapesjs.com/docs/modules/Components.html

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.

#1855March 4, 2019by ssabrewolf3 answers
9 reactions

Copy Paste Components

Hello Grapesjs Team Ive seen the regular copy paste works as long as is made in the same page, Is it possible implement a a copy paste between 2 different pages with the editor opened Thanks in advance

japo32

This is our implementation of using localStorage in case someone needs the solution. Clipboard API would have been a great cross browser solution but it's not yet widely used.

lexoyo

I didn't try it, I just read the code You don't trigger the paste event when pasting in the body Also the css is added in a style tag after each paste... There must be a better way to handle the styles, I'll take a look soon

artf

Is it possible implement a a copy paste between 2 different pages with the editor opened Well, if for 2 different pages you mean 2 different tabs, I don't think so. Obviously, you're dealing with different editor instances so you have to f...

#1854March 4, 2019by NicoEngler3 answers
1 reactions

Asset manager empty on second open

Hi, I am trying to build a plugin which sets up the asset manager as a SVG repository. If the user selects a SVG, the asset manager opens. Next, the user can replace the current SVG with the one selected. Most of the code I am using is found on: https://grapesjs.com/docs/modules/Assets.html#customization Demo: https:/...

noogen

Line 28, you're filtering it twice since you're already doing it on line 23? am.render(am.getAll().filter(assets)); Works when I'm doing it like so: am.render(assets);

NicoEngler

Awesome, thanks for the catch! @noogen

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.

#1853March 4, 2019by MisterFK3 answers
1 reactions

Drag&Drop position

Hi, I try to have the mouse position when i drag&drop a block. Is it possible to have the X position and Y position with this event or another ? editor.on('block:drag:stop', model => [...]); Thanks

NicoEngler

Hi, one attempt to solve this could be:Find the iframe of the canvasFind the mouse position inside the iframe To do so, you could combine functions shared on StackOverflow. The first step could be tackled with the function found right here...

MisterFK

Thanks artf, I already try to catch the onmouseup or onmousemove events on the iframe (and it's work) but when i drag&drop a block the event don't trigger (maybe because the mouse is on the block image)... There is no event grapesjs to hav...

NicoEngler

Well, first off I am not artf :) Second, set up a demo we can work on to solve your issue.

#1852March 4, 2019by ramusesan3 answers
2 reactions

doesn't working with react js

if any changes happened state/reducer then grapes js component doesn't re-rendering any help please

arthuralmeidap

Yeah, GrapesJS doesn't work like that. In this case you will need to get the reference and use the API provided by GrapesJS to handle the changes. Take a look here: https://reactjs.org/docs/refs-and-the-dom.html

ramusesan

yup, it works... great when using ref to DOM and also handles the changes using grapes js' APIs thank you @arthuralmeidap

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.

#1851March 4, 2019by sakshigarg91 answer
0 reactions

Enable multiple image resize

I wish to enable multiple image resize, just like under 'The team' part in demo.html, but I'm unale to figure which gjs class type to use.

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.

#1850March 4, 2019by sunhillbd2 answers
0 reactions

[QUESTION] How to show blocks under different tabs

Hello @artf , Hope you are doing fine. I was trying to show all the blocks under different tabs. For example: displaying sections, columns under Basic tab and other items under another tab named Elements. I have gone through the issue: https://github.com/artf/grapesjs/issues/499 but didn't find any final solution or d...

artf

Hi @sunhillbd I don't know exactly what is not clear in that issue but I think all you have to know is here. With the BlockManager.render method you can control block listing, which logic/UI you'll use (select input, tabs, search, etc.) it...

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.