From f5543ca74e9061f5b631917e6fb15f63db63cac9 Mon Sep 17 00:00:00 2001 From: FrancoisGe Date: Thu, 21 Dec 2023 09:20:29 +0100 Subject: [PATCH] [FIX] web: keydown on list view in a dialog Description: =========== Before this commit, when a line in edit mode in a list view is the last tabable element in a dialog, pressing "tab" does not cause a switch to the next line in edit mode. It is therefore not possible to navigate in this dialog using "tab". Problem: ======= Currently, the ListRenderer listens to keydown events using few t-on-keydown.synthetic in order to know whether to switch the next line to edition. For information, the effect of a synthetic is to create a single listener on "document" instead of creating a listener for each element. There is a conflict with the ui service which listens to all the "tab" keydowns in order to check whether or not we are on the last tabable element of the current activeElement. If we are, we stop the event and focus on the first tabable element. This feature avoids the need to navigate outside dialogs by pressing tab. In our situation, this has the effect of stopping the keydown event before the synthetic can receive it, as the service ui listener is placed on the dialog and the synthetic listener on the document. Solution: ======== Remove the use of synthetic in the ListRenderer. No significant loss of performance was observed. closes odoo/odoo#147027 X-original-commit: 48e154e Related: odoo/enterprise#53150 Signed-off-by: Aaron Bohy (aab) Signed-off-by: Francois Georis (fge) --- .../static/src/views/list/list_renderer.xml | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/addons/web/static/src/views/list/list_renderer.xml b/addons/web/static/src/views/list/list_renderer.xml index 1781d0dd38c..caff9c8511e 100644 --- a/addons/web/static/src/views/list/list_renderer.xml +++ b/addons/web/static/src/views/list/list_renderer.xml @@ -13,7 +13,7 @@ - @@ -22,7 +22,7 @@ t-att-class="getColumnClass(column) + ' opacity-trigger-hover'" t-on-pointerup="onColumnTitleMouseUp" t-on-click="() => this.onClickSortColumn(column)" - t-on-keydown.synthetic="(ev) => this.onCellKeydown(ev)" + t-on-keydown="(ev) => this.onCellKeydown(ev)" t-att-data-tooltip-template="isDebugMode ? 'web.FieldTooltip' : false" t-att-data-tooltip-info="isDebugMode ? makeTooltip(column) : false" data-tooltip-delay="1000" @@ -39,10 +39,10 @@ t-on-pointerdown.stop.prevent="onStartResize"/> - - - - @@ -223,13 +223,13 @@ t-on-touchend="() => this.onRowTouchEnd(record)" t-on-touchmove="() => this.onRowTouchMove(record)" > - -
+ + - - + + Add a line @@ -168,7 +168,7 @@
@@ -203,11 +203,11 @@ + +
+ - + @@ -287,7 +287,7 @@