Skip to content

Comments

fix(web): prevent focus outlines from being clipped in sidebars#26412

Open
slegarraga wants to merge 1 commit intoimmich-app:mainfrom
slegarraga:fix/web-focus-outline-clipping
Open

fix(web): prevent focus outlines from being clipped in sidebars#26412
slegarraga wants to merge 1 commit intoimmich-app:mainfrom
slegarraga:fix/web-focus-outline-clipping

Conversation

@slegarraga
Copy link

Problem

When using Tab to navigate through sidebar items, focus outlines appear clipped/broken because the sidebar's scrollable container (overflow-auto) clips CSS outlines that extend outside element boundaries.

Fixes #19498

Root Cause

The NavbarItem component (from @immich/ui) renders anchor elements with rounded-e-full styling that sit flush against the left edge of the scrollable sidebar container. When focused, the outline extends outside the element's box and gets clipped by the parent's overflow: auto.

Solution

Add ps-1 (4px start padding) to the sidebar content wrappers in both:

  • AdminPageLayout.svelte — the admin sidebar
  • sidebar.svelte — the user sidebar

This provides just enough space for the 2px outline + 2px offset to render fully without being clipped by the overflow container.

Changes

  • web/src/lib/components/layouts/AdminPageLayout.svelte — added ps-1 to nav items wrapper
  • web/src/lib/components/sidebar/sidebar.svelte — added ps-1 to content wrapper

Add start padding (ps-1) to sidebar content wrappers so that
focus-visible outlines on NavbarItem links are not clipped by
the parent container's overflow.

The NavbarItem component renders links with rounded-e-full styling
that sit flush against the left edge of the scrollable sidebar.
When focused, the browser's outline extends outside the element
boundary and gets clipped by the overflow-auto on the sidebar's
scroll container. Adding 4px of start padding provides space
for the outline to render fully.

Applied to both the admin sidebar (AdminPageLayout) and the user
sidebar (sidebar.svelte) for consistency.

Fixes immich-app#19498
@immich-push-o-matic
Copy link

immich-push-o-matic bot commented Feb 21, 2026

Label error. Requires exactly 1 of: changelog:.*. Found: 🖥️web. A maintainer will add the required label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Focus outlines are broken/inconsistent

1 participant