mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[PR #13695] [MERGED] feat: focus trap modal #23265
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/13695
Author: @sinejespersen
Created: 5/8/2025
Status: ✅ Merged
Merged: 5/8/2025
Merged by: @tjbck
Base:
dev← Head:8908-focus-trap-modal📝 Commits (5)
f569836add npm package svelte-focus-trap54b30e0use svelte-focus-trap in modalbd2021eadd aria modal true and role dialog to modal305435buse npm package focus-trap instead of npm package focus-trap-svelte3886deeadd whitespace and semi colon📊 Changes
3 files changed (+19 additions, -4 deletions)
View changed files
📝
package-lock.json(+5 -3)📝
package.json(+1 -0)📝
src/lib/components/common/Modal.svelte(+13 -1)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
As per https://github.com/open-webui/open-webui/discussions/8908
Focus in modals has to do with the two following success criterions: SC 2.1.1: Keyboard (Level A) and SC 2.1.1 Keyboard (Level A).
If focus leaves the modal and reaches elements in the background, the user might get lost or confused, violating logical focus order.
Added
Modal.svelte, which traps the keyboard inside the modal while the modal is open.aria-modal="true"to dialog: Indicates that interaction with the rest of the page is disabled while the modal is open.role="dialog"to dialog: Helps screen readers understand that this is a distinct interface element requiring user interaction.Changed
N/A or see above
Deprecated
N/A
Removed
N/A
Fixed
N/A
Security
N/A
Breaking Changes
N/A
Additional Information
The npm package can be found here: focus-trap
Screenshots or Videos
Tabbing between buttons in modal, console shows which element is in focus:
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.