Skip to content

Collapsed mobile sidebar remains focusable and exposed off-screen #2777

Description

@neylwalecki

Flux version

v2.17.1

Livewire version

v4.4.2

Tailwind version

v4.3.3

Browser and Operating System

Google Chrome 147.0.0.0 on macOS 27.0

What is the problem?

At a mobile viewport, a sidebar with collapsible="mobile" receives
data-flux-sidebar-collapsed-mobile and is positioned outside the viewport,
but it does not receive inert or aria-hidden. Its links remain in the
accessibility tree and sequential keyboard navigation.

In a 390 × 844 reproduction, the closed sidebar was at x: -256 with a width
of 256px. The first and second Tab presses focused its off-screen
Dashboard and Reports links; only the third reached the visible sidebar
toggle. axe does not report this state, but the browser accessibility snapshot
and real keyboard order both expose it.

This is distinct from #2643 and #2649, which addressed collapsed desktop group
navigation and focus behavior rather than hiding a closed mobile sidebar.

Code snippets to replicate the problem

<flux:sidebar sticky collapsible="mobile">
    <flux:sidebar.nav>
        <flux:sidebar.item href="/dashboard">Dashboard</flux:sidebar.item>
    </flux:sidebar.nav>
</flux:sidebar>
  1. Open the page at a mobile viewport.
  2. Close the sidebar.
  3. Confirm the sidebar has data-flux-sidebar-collapsed-mobile and is outside
    the viewport.
  4. Inspect the accessibility tree and press Tab from the start of the page.
  5. Observe the sidebar links before the visible toggle and page content.

Relevant closed-state output:

<ui-sidebar
    data-flux-sidebar
    data-flux-sidebar-on-mobile
    data-flux-sidebar-collapsed-mobile
>
    <a href="/dashboard">Dashboard</a>
    <a href="/reports">Reports</a>
</ui-sidebar>
aria-hidden: null
inert: false
sidebar rect: x -256, width 256
Tab 1: Dashboard at x -240
Tab 2: Reports at x -240
Tab 3: Toggle sidebar at x 24

Screenshots/ screen recordings of the problem

Not applicable. The defect occurs while the sidebar is off-screen; the exact
DOM state, geometry, accessibility snapshot and keyboard order are included
above as searchable text.

How do you expect it to work?

The collapsed mobile sidebar should be absent from sequential focus and the
accessibility tree. Opening it should restore access to its controls, and
closing it should preserve Flux's focus-return behavior.

Please confirm (incomplete submissions will not be addressed)

  • I have provided easy and step-by-step instructions to reproduce the bug.
  • I have provided code samples as text and NOT images.
  • I understand my bug report will be closed if I haven't met the criteria above.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions