Commit graph

29 commits

Author SHA1 Message Date
Vince Castillo, PhD
6379d37863
fix: expose ConfirmDialog with dialog role and label its input (WCAG 4.1.2, 3.3.2) (#26769)
ConfirmDialog trapped focus and closed on Escape but its container was a plain
  div, so screen readers did not announce it as a modal dialog. Its text input
  also had only a placeholder, giving no persistent accessible name. Add
  role=dialog / aria-modal / aria-label / tabindex to the dialog surface and an
  aria-label to the textarea.

  Relates to #2790

Co-authored-by: Tim Baek <tim@openwebui.com>
2026-07-27 01:15:12 -04:00
Classic298
65473b6ffa
fix: stop Enter on Cancel from confirming ConfirmDialog (WCAG 3.2.2) (#27491)
On latest `dev`, `ConfirmDialog` registers `handleKeyDown` on `window` and treats **every** Enter keypress as Confirm, calling `event.preventDefault()` first so the focused control never gets its native activation.

The dialog also activates a focus trap with no `initialFocus`, so focus-trap falls back to the first tabbable node, which is the **Cancel** button. So the dialog opens with Cancel focused, and pressing Enter runs Confirm.

This is the confirm surface for Delete chat, Delete folder, Delete model, Delete knowledge base and ~40 other call sites. A keyboard user who tabs to Cancel and presses Enter deletes the thing they were trying to keep. Screen reader users are hit hardest, since they cannot see which button they are on and the control that means "back out safely" performs the irreversible action instead.

Two related paths have the same cause: Enter in the `input=true` textarea submits instead of inserting a newline, and a markdown link inside `message` (reachable via `eventConfirmationMessage` from tool `__event_call__` payloads, and via `web_search_confirmation_content`) becomes the first tabbable node, so Enter on that link confirms instead of following it.

Breaks WCAG 3.2.2 On Input (Level A): changing the focused control changes what the Enter key does, and activating a control performs a different action than the one it is labelled with. Also 2.1.1 Keyboard (Level A), since Cancel has no working keyboard activation.

Fix: let the focused control act on Enter itself, and only fall back to Confirm otherwise. Uses the same `target instanceof Element && target.closest(...)` guard already used in `Functions.svelte`, `Knowledge.svelte`, `Models.svelte`, `Prompts.svelte`, `Skills.svelte` and `Tools.svelte`. `select` is deliberately not in the list, because a native `select` does not act on Enter and excluding it would silently break confirm for the `inputType === 'select'` variant. Two stray `console.log` calls in the same function are removed.

Behaviour after this change: Enter on Cancel cancels, Enter on Confirm confirms, Enter in the textarea inserts a newline, Enter on a link follows it, and Enter anywhere else still confirms as before.

Severity: Critical. Silent, unrecoverable data loss triggered by the most ordinary keyboard interaction there is.

### Contributor License Agreement

<!--
🚨 DO NOT DELETE THE TEXT BELOW 🚨
Keep the "Contributor License Agreement" confirmation text intact.
Deleting it will trigger the CLA-Bot to INVALIDATE your PR.

Your PR will NOT be reviewed or merged until you check the box below confirming that you have read and agree to the terms of the CLA.
-->

- [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.

> [!NOTE]
> Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.
2026-07-26 17:37:21 -04:00
Timothy Jaeryang Baek
d859110311 refac 2026-07-15 04:29:16 -04:00
Timothy Jaeryang Baek
309313db68 refac 2026-07-15 03:16:06 -04:00
Timothy Jaeryang Baek
aedb6bef4e refac 2026-07-14 04:15:20 -04:00
Timothy Jaeryang Baek
0016266c06 refac 2026-07-01 02:49:33 -05:00
Timothy Jaeryang Baek
422a4768ea refac 2026-06-29 05:14:03 -05:00
Timothy Jaeryang Baek
9364e2fb74 refac 2026-03-25 16:48:57 -05:00
Timothy Jaeryang Baek
9044abf3bb chore: format 2026-02-23 01:40:53 -06:00
Timothy Jaeryang Baek
4853ededca refac 2026-02-22 18:05:25 -06:00
Timothy Jaeryang Baek
57a2024c58 refac 2026-01-27 23:55:49 +04:00
Timothy Jaeryang Baek
2f398895c6 refac: styling 2025-10-06 00:02:22 -05:00
Timothy Jaeryang Baek
c42a6d8029 refac/fix: node dom issue 2025-07-08 10:00:20 +04:00
Timothy Jaeryang Baek
fb26be7dd6 fix: confirm dialog input reset on show 2025-06-17 14:24:23 +04:00
Timothy Jaeryang Baek
be85f7cc35 fix: confirm dialog focus 2025-05-10 22:09:05 +04:00
Timothy Jaeryang Baek
26e9cd0b4b enh: user role update confirm dialog 2025-05-05 16:10:36 +04:00
Timothy Jaeryang Baek
e3fa48b6ce chore: tailwind v4 migration 2025-02-15 19:27:25 -08:00
Timothy Jaeryang Baek
7ad8918cd9 enh: update channel 2024-12-22 23:09:51 -07:00
Timothy Jaeryang Baek
81bb2750e0 enh: reset models 2024-11-19 11:03:36 -08:00
Timothy Jaeryang Baek
9a546c34bb refac: confirm dialog z index 2024-11-10 18:35:18 -08:00
Timothy J. Baek
0556479cbe enh: ctrl+shift+delete chat delete support 2024-10-19 01:06:30 -07:00
Timothy J. Baek
601982f52b fix: lengthy chat title delete ui issue 2024-09-09 04:52:12 +01:00
Peter De-Ath
cbe3694b81 refac: add eventConfirmationInputValue handling in Chat.svelte 2024-07-22 20:43:31 +01:00
Timothy J. Baek
90c3d68f00 enh: input type event call 2024-07-11 17:30:24 -07:00
Timothy J. Baek
1b7ff1c5df feat: __event_call__ support 2024-07-08 21:39:06 -07:00
Timothy J. Baek
9023a60d0d refac 2024-06-17 01:42:04 -07:00
Karl Lee
720ff35edf Add some missing i18n keys and update Chinese translation
Add some missing i18n keys and update Chinese translation
2024-06-17 16:32:36 +08:00
Timothy J. Baek
aba2ca39d4 enh: delete confirm dialog 2024-06-14 11:24:15 -07:00
Timothy J. Baek
a691ee08d8 feat: confirm dialog 2024-06-12 01:17:46 -07:00