[FIX] web_editor: persist URL-like text transformation to link
Commit [1] separated the two responsabilites of _onURLInput: making
changes to the DOM and updating the UI, taking care that only the second
one is done at start.
But this broke the following functionality:
- Have a URL-like text (ex: odoo.com), select it and click the link icon
on the sidebar.
- The URL is deduced from the link's label.
- Click anywhere to close the sidebar.
Before [1], the link transformation would be kept. After it, it is not.
This happens because this is a particular case in which we want to apply
changes to the DOM at start time, as if a URL input event had happened.
This commit fixes it.
task-3284649
[1]: 54746012d3
X-original-commit: da0a3f34401547478107945626034d7932855f02
Part-of: odoo/odoo#136278
This commit is contained in:
@@ -86,6 +86,12 @@ export class LinkTools extends Link {
|
||||
|
||||
this._setSelectOptionFromLink();
|
||||
this._updateOptionsUI();
|
||||
|
||||
if (!this.linkEl.href && this.state.url) {
|
||||
// Link URL was deduced from label. Apply changes to DOM.
|
||||
this.__onURLInput();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
destroy() {
|
||||
|
||||
Reference in New Issue
Block a user