render method is repeated for a custom Component
Question
I have created a custom Component when I click on it to put it in the editor, the render method is repeated as long I still click on it, I want the render method to just work when i put the component in the editor
Answers (3)
Hi Ahmed, when you drag a component in the canvas a temporary one is created to check some functionality. If you need to skip something inside the render method you can check if it's temporary in this way
render() {
...
if (!this.model.opt.temporary) {
// do something...
}
...
}
@artf thank you very much that's what i want
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 #1643
Render New Html to editor with Action of Traits
I create New custom Tool with (default html) when draged , and i also create traits for this component when i click on checkbox excuting fu...
Issue #1696
Traits appear first time when draged custom component
Hi artf , i have created custom component and add traits for it , when dragging this component to editor and select it the setting traits w...
Issue #1493
[QUESTION] render() works on the first time but not on subsequent calls
Hello, I've created a custom component that shows images using background-image on a <div> instead of using an <img> element. It's mostly w...
Issue #1995
[QUESTION] Binded events are not being loaded (Just work properly on mozilla firefox)
So I am using local Storage. I added some events to the component this way. Every time I add the component it works just fine. However, If...
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.