From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 88C321FF0E5 for ; Wed, 15 Jul 2026 11:28:49 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E6B7D21338; Wed, 15 Jul 2026 11:28:48 +0200 (CEST) Message-ID: Date: Wed, 15 Jul 2026 11:28:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: applied: [PATCH yew-widget-toolkit v2] widget: dialog: prevent Escape from closing non-closable modals To: Dominik Csapak , yew-devel@lists.proxmox.com References: <20260709141455.623886-1-d.csapak@proxmox.com> Content-Language: en-US From: Thomas Lamprecht In-Reply-To: <20260709141455.623886-1-d.csapak@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784107706238 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.331 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust 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: YU42X7PQ2QJ2GY2E6FHA5VA3QBU6TURJ X-Message-ID-Hash: YU42X7PQ2QJ2GY2E6FHA5VA3QBU6TURJ X-MailFrom: t.lamprecht@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: Am 09.07.26 um 16:14 schrieb Dominik Csapak: > Pressing Escape on a triggers the browser's native close > handling regardless of whether our code considers the dialog closable. > When the dialog has no 'on_close' callback (e.g. a Login Window), this > leaves our component state and the native dialog state out of sync: the > browser treats the dialog as closed, while our widget is still rendered > but without the corresponding 'open' CSS class (which hides the > backdrop). > > Intercept the KeyDown event and call stop_propagation()/ > prevent_default() for Escape whenever the dialog isn't closable, > so the browser never fires its native close in the first place. > > Signed-off-by: Dominik Csapak > --- > changes from v1: > * drop the leftover debug log::info line > > src/widget/dialog.rs | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > for the record, this has been applied by Dietmar: https://git.proxmox.com/?p=ui/proxmox-yew-widget-toolkit.git;a=commitdiff;h=862559c5fe4e8355d3eed76522e6ec7b27a35e79