Make emoji picker close automatically if input parent element is destroyed

This commit is contained in:
Pierre
2018-04-20 16:52:17 +02:00
parent b05a26d734
commit 3cee773de0
2 changed files with 35 additions and 1 deletions

View File

@ -289,6 +289,20 @@
addClass(this, 'wdt-emoji-picker-open');
//this.innerHTML = wdtEmojiBundle.emoji.replace_colons(':sunglasses:'); //COMUNIC - EDIT
//COMUNIC EDIT
//Make the picker close automatically if the parent element is removed
var interval = setInterval(function(){
if(!parent.isConnected){
wdtEmojiBundle.close();
clearInterval(interval);
}
}, 2500);
//END COMUNIC EDIT
};
/**