[IMP] web_editor: scroll to new element of we-list

This commit improves the ListUserValueWidget to scoll to the new element
when the user adds a new element.

task-2601533

closes odoo/odoo#81241

Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
This commit is contained in:
Guillaume (gdi)
2023-02-17 12:07:02 +01:00
parent 0263ec8cc8
commit cf1a8f34b1
@@ -2249,6 +2249,9 @@ const ListUserValueWidget = UserValueWidget.extend({
}
this._addItemToTable(undefined, this.el.dataset.defaultValue, recordData);
this._notifyCurrentState();
// Scroll to the new list element.
this.el.querySelector('tr:last-child')
.scrollIntoView({behavior: 'smooth', block: 'nearest'});
},
/**
* @private