Help Wanted : On Trait update
Question
Hello,
I have applied a href trait on image tag. Can you please tell me which event fires when href trait is changed for that.
Thanks,
Answers (2)
Hi @vishal5033,
The component:update event should get triggered when a trait changes, but it's also going to fire when anything changes. You could check for the specific trait (href) by inspecting the changed property of the component object that's passed to the callback. Maybe something like this:
editor.on("component:update", function(component) {
if (component.changed && component.changed.attributes && component.changed.attributes.href) {
console.log("href changed!", component);
};
})
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.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #563
Table <thead> and <tbody> tag gets Omitted
Hello, There is new issue with GrapesJS (maybe). I've created new component using bm.add() in which I've used a table element with <thead>...
Issue #1506
Css Media Query Issue
Hello @artf There is an issue on demo page as well as library in media query. Issue is that if user update style on mobile view first and t...
Issue #1836
How to add !important in all the generated apis
Hello @artf, While i am going to edit some html from editor with the help of css then i need to add !important into all the css which is ch...
Issue #1816
Not allowing to upload same image on same the position after delete that image
Ajax call which is uploading image file in assests folder It's working fine to add an image from the local. But in another scenario, It's n...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.