Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default component settings not updated in html if not changed. #230

Closed
aryeharmon opened this issue Aug 14, 2017 · 8 comments
Closed

default component settings not updated in html if not changed. #230

aryeharmon opened this issue Aug 14, 2017 · 8 comments

Comments

@aryeharmon
Copy link
Contributor

No description provided.

@artf
Copy link
Member

artf commented Aug 14, 2017

thanks @aryeharmon can you provide an example of your issue?

@aryeharmon
Copy link
Contributor Author

aryeharmon commented Aug 14, 2017

If for example i have a component with traits:

[{
        name: 'ng-repeat',
        value: 'e in data track by $index',
        default: 'e in data track by $index',
}]

if i add a block with that component, when i add it to the page. the html element will not have my default settings. only if i change the value in the settings will the element update

// before change settings tab
<some-component></some-component>

// after change settings tab
<some-component ng-repeat="x in y"></some-component>

i hope i'm clear, let me know if not i will try to explain better.

@artf artf added the bug label Aug 15, 2017
@artf
Copy link
Member

artf commented Aug 15, 2017

thanks @aryeharmon got it and confirmed

@aryeharmon
Copy link
Contributor Author

aryeharmon commented Aug 15, 2017

I tried changing the the value on block drop event, however this only worked when the component was selected.
Can you give me some hint about where and when i should implement this?

@artf
Copy link
Member

artf commented Aug 16, 2017

@aryeharmon you might want this

editor.on('block:drag:stop', function(model){
 //...
});

@aryeharmon
Copy link
Contributor Author

@artf it seems like the html only gets updated on a component that is selected by the builder. how would i would automatically select a component that is dropped?

aryeharmon added a commit to aryeharmon/grapesjs that referenced this issue Aug 17, 2017
@artf
Copy link
Member

artf commented Aug 17, 2017

thanks @aryeharmon just realized I haven't provided an easy API method to select a component, will add it in the next release

@artf artf closed this as completed in 562e0e0 Aug 17, 2017
@lock
Copy link

lock bot commented Sep 18, 2019

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.

@lock lock bot added the outdated label Sep 18, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants