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 733FE1FF13C for ; Thu, 19 Mar 2026 18:05:05 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E80B37487; Thu, 19 Mar 2026 18:05:20 +0100 (CET) From: Christoph Heiss To: yew-devel@lists.proxmox.com Subject: [PATCH yew-widget-toolkit 2/2] widget: form: number: allow focusing the input on click Date: Thu, 19 Mar 2026 18:04:18 +0100 Message-ID: <20260319170432.1533393-3-c.heiss@proxmox.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260319170432.1533393-1-c.heiss@proxmox.com> References: <20260319170432.1533393-1-c.heiss@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773939844803 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.054 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 Message-ID-Hash: 7EIKHYL2SPBNCYO4NWS4AU5ZGVXPIHZY X-Message-ID-Hash: 7EIKHYL2SPBNCYO4NWS4AU5ZGVXPIHZY X-MailFrom: c.heiss@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Yew framework devel list at Proxmox List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The `.prevent_default()` on the input elements `onmousedown` handler is not needed and actually prevents the input from being focused by clicking, since the event will never reach it. Drop it. The returned `SpinnerStop` value is just a dummy, so safe to remove the entire handler. Signed-off-by: Christoph Heiss --- src/widget/form/number.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/widget/form/number.rs b/src/widget/form/number.rs index 6db7063..82d66b4 100644 --- a/src/widget/form/number.rs +++ b/src/widget/form/number.rs @@ -665,12 +665,6 @@ impl ManagedField for NumberField { } }); - let on_mouse_down = ctx.link().callback(|event: MouseEvent| { - // prevent focus loss - event.prevent_default(); - Msg::SpinnerStop // dummy - }); - let input_props = props.input_props.clone(); let inputmode = if T::is_decimal() { @@ -702,7 +696,6 @@ impl ManagedField for NumberField { event.prevent_default(); } }) - .onmousedown(on_mouse_down) .into_html_with_ref(self.input_ref.clone()); let mut input_container = Tooltip::empty() -- 2.53.0