From cb0b44435943eff89a4ffa51d264be2b67945fc2 Mon Sep 17 00:00:00 2001 From: "Arthur Detroux (ard)" Date: Tue, 9 Apr 2024 11:27:43 +0200 Subject: [PATCH] [FIX] website: avoid useless re-rendering in URLPicker Steps to reproduce: - Drop an Text - Image block - Click on the Image - Click on the link button next to replace - Try typing a URL => Typing a URL is hard because the widget keeps re-rendering Reason: Since [1], the jQueryUI urlcomplete widget was changed into an OWL widget. This added a call to `urlChosen` on input, which leads to the SnippetsMenu re-rendering the options. This commit fixes that by remove the call to `urlChosen`. Nothing is lost since the input is already handling its own changes. Instead, urlChosen is only called when selecting an element from the dropdown. [1]: https://github.com/odoo/odoo/commit/86a9171ec7790aa09f2b9a50dcb26deb029e8bed closes odoo/odoo#161045 Signed-off-by: Robin Lejeune (role) Co-authored-by: =?UTF-8?q?Nguy=E1=BB=85n=20=C4=90=E1=BA=A1i=20D=C6=B0=C6=A1ng?= --- .../src/components/autocomplete_with_pages/url_autocomplete.js | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/website/static/src/components/autocomplete_with_pages/url_autocomplete.js b/addons/website/static/src/components/autocomplete_with_pages/url_autocomplete.js index ff288b0f1ce..ad899751976 100644 --- a/addons/website/static/src/components/autocomplete_with_pages/url_autocomplete.js +++ b/addons/website/static/src/components/autocomplete_with_pages/url_autocomplete.js @@ -84,7 +84,6 @@ export class UrlAutoComplete extends Component { onInput({ inputValue }) { this.props.targetDropdown.value = inputValue; - this.props.options.urlChosen?.(); } }