Skip to content

Regression: ariaHideOutside drops aria-hidden during immediate modal ownership handoff #720

Closed

Description

@2l42h3r

Describe the bug

In @kobalte/core 0.13.13, handing background isolation directly from one modal to another can leave the application without aria-hidden="true" while the second modal remains active.

The same sequence works correctly in 0.13.12.

To Reproduce

Reproduction: https://github.com/2l42h3r/kobalte-aria-hidden-handoff-repro

  1. Clone the reproduction repository.
  2. Run pnpm install --frozen-lockfile.
  3. Run pnpm test to compare 0.13.12 and 0.13.13.
  4. Run pnpm reproduce.

The last command fails with:

The second modal must retain aria-hidden ownership of the application: expected null to be 'true'

The minimal sequence is:

  1. ariaHideOutside owner A hides the background.
  2. Owner A is reverted.
  3. Owner B is created immediately, before A's deferred cleanup executes.
  4. After the deferred timer/frame boundary, the background no longer has aria-hidden.

Expected behavior

The background should remain aria-hidden="true" for as long as owner B is active. It should become visible only after owner B is reverted.

Screenshots

Not applicable; this is an attribute-state regression. The reproduction contains an automated comparison and failing invariant test.

Desktop (please complete the following information):

  • OS: macOS
  • @kobalte/core: 0.13.13
  • solid-js: 1.9.14
  • Automated environment: Happy DOM 20.11.2
  • Node.js: 24.19.0

Additional context

This appears to have been introduced by #700.

Cleanup schedules aria-hidden removal but immediately deletes the node's ref-count entry. A new owner sees an already-hidden node with a zero ref count and skips registering ownership. The earlier deferred callback then removes the attribute.

I would be happy to submit a fix and regression test.

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