Issue #3604Opened July 9, 2021by NoumanAhmad-Braqsol0 reactions

editor.on('component:update:content', model => { }}) not work in some cause

Question

if the user remove all text from a element and click some where else . then again try to select empty element he is not able to select it again because it is hide and i dont know where it goes. So for this issue I am using this code

editor.on('component:update:content', model => {
const val = model.get('content');
if(val && val.length < 1){
model.set('content', '&nbsp');
}
})

this code set a space in text if user remove all text from a element . By doing this these is no empty element so i does not hide . and again we can select it . if the user remove text character one by one it works fine . But now issue is that if a user select a text by CTRL + A and remove by BACKSPACE . At this time this above code not work . Can anyone help me .

Answers (2)

NoumanAhmad-BraqsolJuly 29, 20210 reactions

Thank you i got it !

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.