From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id E28751FF187 for ; Tue, 2 Dec 2025 16:57:43 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5A14016EFA; Tue, 2 Dec 2025 16:58:09 +0100 (CET) From: Dominik Csapak To: yew-devel@lists.proxmox.com Date: Tue, 2 Dec 2025 16:57:59 +0100 Message-ID: <20251202155805.110540-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [yew-devel] [PATCH yew-widget-toolkit] improve keyboard navigation with fields in data tables X-BeenThere: yew-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Yew framework devel list at Proxmox List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Yew framework devel list at Proxmox Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: yew-devel-bounces@lists.proxmox.com Sender: "yew-devel" when inside an input field in a data table, the intention was to focus the next cell when pressing tab. This currently does not work correctly, since 'cell_focus_next' tries to focus the next element next to the already focused one, and that is not the cell itself but the field inside. Instead of trying to fix that, simply let the browser handle the focus handling. This has the advantage that in table with multiple fields (like we have in the PDM node list for remotes) we directly focus the next input field instead of the next cell (which would need another press of 'tab' to focus the input field). The downside is that to focus the next cell (if it does not contain an input), one has to "go out" of the field by pressing F2 and then pressing tab. Since in a data table with fields it is often more useful to navigate between those instead of the table cells, i opted for this solution. In addition, add a tabindex of '0' to the triggers, so they'll always be able to be focused. Signed-off-by: Dominik Csapak --- src/widget/data_table/data_table.rs | 5 +---- src/widget/trigger.rs | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/widget/data_table/data_table.rs b/src/widget/data_table/data_table.rs index 7805340..8a68e8c 100644 --- a/src/widget/data_table/data_table.rs +++ b/src/widget/data_table/data_table.rs @@ -1220,10 +1220,7 @@ impl Component for PwtDataTable { event.prevent_default(); self.cell_focus_next(&record_key, true); } - "Tab" if inside_input => { - event.prevent_default(); - self.cell_focus_next(&record_key, !shift); - } + "Tab" if inside_input => {} " " if !inside_input => { // avoid scrollbar default action event.prevent_default(); diff --git a/src/widget/trigger.rs b/src/widget/trigger.rs index be8d8fb..a5d19cf 100644 --- a/src/widget/trigger.rs +++ b/src/widget/trigger.rs @@ -68,7 +68,7 @@ impl Component for PwtTrigger { None, ); - Tooltip::new(icon).tip(props.tip).into() + Tooltip::new(icon).tabindex(0).tip(props.tip).into() } } -- 2.47.3 _______________________________________________ yew-devel mailing list yew-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel