grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

traits setting not work after reload

Open kuldeepcis opened this issue 8 years ago • 2 comments

Hello @artf previous issue

Yes, you're right traits are there but you didn't read the my issues those I'm facing.

1. when you drag and drop a social element, to change the value you've to select element first after that parent of that. Direct element not selected. 2) Traits value not pre-selected on page load. 3) when you export it the facebook icon is not having the URL which we set.Please let me know how we can do that.

kuldeepcis avatar May 13 '18 11:05 kuldeepcis

  1. This is because you're selecting your div wrapper and not the actual component, you can make not selectable: <div data-js="social-icons" data-gjs-selectable="false"> ...
  2. Trait's value is set from the component's model, so if you use changeProp the value is inside component.get(TRAIT_NAME) otherwise component.getAttributes()[TRAIT_NAME]
  3. The final code is built from the model, not from what YOU edit in canvas. When you trigger the method on change:facebook_url and do facebookUrl.href = facebook_url you're just updating the view and not the model of that element. Please read carefully here

artf avatar May 13 '18 21:05 artf

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[bot] avatar Sep 17 '19 16:09 lock[bot]