GrapesJS Issues

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

829 issues found

๐Ÿ” question
#1951April 9, 2019by fmr4113 answers
0 reactions

[QUESTIONS] change or add event on add component from block

is it possible ?, change the drag and drop event to on click when adding a new component, I want to add components by clicking the block then it will be added directly to the selected component, Thank's

artf

Not really, but I was already thinking about this possibility, so probably I'll add it in the next release. I'd ask what would you expect in case of your gif? On click, the block should be added inside the cell?

fmr411

Yes, I want when I click, the block is added to the cell, but can I know where the function handles the event to add the block?

artf

https://github.com/artf/grapesjs/blob/dev/src/block_manager/view/BlockView.js#L7-L8

#1940April 2, 2019by ankitjainOfficial3 answers
3 reactions

[QUESTION] Add custom font

Hello, I went through, the following GitHub issues: #857 #1622 #1215 Almost all of the issues, though a little different, provide a way to add font family to the list. Most common way to tackle, as far as I've understood: For both of this, I'm getting the typographySector and fontProperty as undefined. I don't know, i...

artf

Try using this editor.StyleManager.getProperty('typography', 'font-family')

workadev

Hi @ankitjainOfficial, I'm new to this so can you please help me how to add some Google fonts in detail? Thanks in advance.

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.

#1938April 2, 2019by CharlesBilbo2 answers
0 reactions

[QUESTION] what would be the best way to store the template dynamically

I'm looking to store data dynamically though a id that is called in, at the moment I'm loading in templates dynamically but cant seem to figure out a way to store them. below is a rough idea but something along those lines , any help is appreciated. `

artf

editor.StorageManager.getConfig().urlStore = 'save/' + id;

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.

#1931March 28, 2019by sanjib002 answers
0 reactions

[Question]: How to insert image inside the link?

Hi @artf , How can I insert image inside the link? Please share your ideas what I need to do. If I need to create any custom component, please share some code. Thanks

artf

On the demo, you should see the 'Link block' which is made for this purpose

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.

#1930March 28, 2019by rikoyudiansyah12 answers
0 reactions

[QUESTIONS] change 2 attributes with 1 trait

I have an input trait, I want to change the 2 attributes (name and type) on the selected input element, on canvas is appropriate, but in the final html(editor.getHtml()) it doesn't work, I've read https://grapesjs.com/docs/modules/Components.html#define-new-component but I didn't find a solution, Thank's

artf

You should change the model and not the view element this.model.setAttributes({ 'data-attr': 'value' })

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.

#1928March 27, 2019by Ericson19913 answers
0 reactions

[QUESTIONS] Change the Onclick event to Hover when select objects

Can I change the onclick event to hover when select objects and display a toolbar?

artf

You might need to extend the SelectComponent command (take a look at toggleSelectComponent method)

afdallah

@artf Is there any example on how to extend the SelectComponent?

artf

mmm not really, I hope to publish soon a general doc about Commands. BTW it's just about getting the command (https://grapesjs.com/docs/api/commands.html#get) and overwriting its method

#1927March 27, 2019by edward18933 answers
0 reactions

[QUESTIONS] Sender.set('active') error Maximum call stack size exceeded

I have a button with the show-left command, I want to make when the button is clicked a second time (or more) remains active, but when running Sender.set ('active') in the stop function, there is a loop on stop so that an error appears Maximum call stack size exceeded First click Second click My Commands

artf

Create a reproducible demo, please

edward1893

I have 3 buttons, I want when the button is clicked for the second time (or more), the button remains active, for example, when first clicking on the layer, the layer button becomes active, if clicked again the layer button will remain act...

artf

use togglable: false instead of togglable: true

#1926March 27, 2019by fmr4112 answers
0 reactions

[QUESTIONS] Edit Placeholder on keyup in Trait

How so that Placeholders can change when typing a word in the trait directly, current placeholders can change only when mouseover I have a trait like this, is there anything that isn't right? Thank you :

artf

I think you might need to create a new trait type for a custom behavior

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.

#1924March 26, 2019by Aleksandrov913 answers
0 reactions

[Question] Create dropdown menu inside options panel

I'm trying to create dropdown menu (like the device selection menu) inside options panel. In the documentation is described how can create panels and buttons only. How to do that?

artf

It was created by its own view so nothing special, there is no API to create select inputs, do them as you wish with your framework of choice then on change just bind your actions

Soharab-Shaikh

@artf Could you please help me to add select input(dropdown) inside the device panel?

alimurad52

@artf can you provide an example of this?

#1917March 24, 2019by trafalmejo2 answers
0 reactions

[QUESTIONS] Icons on Block Manager

Hi, I want to change the icon of a Block in the Block Manager: I know it is part of the attributes in the manner: attributes: { class:'gjs-fonts gjs-f-b1' } and the class defines the icon to be used. Where is the list of icons? I didn't find it in the documentation: Block Manager. Thanks!

artf

There is no list of icons, we used fontawesome and some custom one but we're planning to remove them from the core

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.