From ac3c857a577d6937d9b157d11d4590119e358455 Mon Sep 17 00:00:00 2001 From: Rahul Prajapati Date: Thu, 24 Mar 2022 09:34:58 +0000 Subject: [PATCH] [FIX] mail: html tags visible for a split second at channel creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit: When you create a new channel HTML tags are visible in Autocomplete text area for a split second After this commit: Added prevendDefault for the autocomplete select event to stop it's defaullt behaviour as changing the autocomplete text area's value by the selected item's value Task-2792365 closes odoo/odoo#88148 X-original-commit: cc11accfeca4bee0f4a364bf59b6311a99855c2b Signed-off-by: Sébastien Theys (seb) --- addons/mail/static/src/models/discuss.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/mail/static/src/models/discuss.js b/addons/mail/static/src/models/discuss.js index c44eee4de82..3ff68d89164 100644 --- a/addons/mail/static/src/models/discuss.js +++ b/addons/mail/static/src/models/discuss.js @@ -34,6 +34,9 @@ registerModel({ * @param {integer} ui.item.id */ async handleAddChannelAutocompleteSelect(ev, ui) { + // Necessary in order to prevent AutocompleteSelect event's default + // behaviour as html tags visible for a split second in text area + ev.preventDefault(); const name = this.addingChannelValue; this.clearIsAddingItem(); if (ui.item.special) {