Skip to content
Bug reportDec 4, 2026· 0:22· 5 views

Ariakit Dialog: closing dialog erases unrelated inline body styles (--example custom property cleared on close)

0:22 total

Comments · 0

Be the first to comment.

Bug reportby SceneRecap AI

mediumDialog scroll-lock style restore on close. It seems to reset the whole body inline style instead of restoring only the properties it changed.
os: macOSdpr: 1locale: en-USbrowser: Chromium 151.0.7922.34timezone: Europe/Berlinviewport: 1280x720page_title: Ariakit Dialog scroll-lock clears body styles, #8659

Repro steps

  1. 1.Load the #8659 test page. The dialog is already open and the status box reads 'body --example: (not set)'.
  2. 2.Click the 'Set body --example' button while the dialog is open.
  3. 3.Confirm the status box reads 'body --example: "changed"'.
  4. 4.Click the 'Close dialog' button.
  5. 5.Observe that the status box now reports body --example as an empty string.

Expected

Closing the dialog restores only the body styles that the scroll lock changed. The unrelated inline custom property --example on body keeps the value "changed".

Actual

After 'Close dialog' is clicked, body --example becomes an empty string. The page reports it as erased on dialog close, and a failure banner states it was erased by scroll-lock restore.

Evidence

visualBaseline: the status box reads 'body --example: (not set)' with the dialog open.
visualAfter the 'Set body --example' click, the status box turns green and reads 'body --example: "changed"' with a check mark. Setting the property works.
visualThe value is still "changed" at the moment 'Close dialog' is clicked.
visualThe status box turns red and reads 'body --example: "", erased on dialog close'.
visualA red banner at the bottom reads 'getPropertyValue('--example') === "", erased by scroll-lock restore'.
visualThe dialog panel still shows 'Dialog is open' after the close click. The frames do not show the dialog hiding.
Issue markdown (copy-paste ready)
## Summary
Closing an Ariakit Dialog erases an unrelated inline custom property (`--example`) on `document.body`. The test page attributes this to the scroll-lock restore (ariakit/ariakit#8659).

## Environment
- Chromium 151.0.7922.34, macOS
- Viewport 1280x720, DPR 1
- Page: "Ariakit Dialog scroll-lock clears body styles, #8659"

## Steps to reproduce
1. Load the test page. The dialog is open and the status reads `body --example: (not set)` (1.0s).
2. Click **Set body --example** (6.3s).
3. The status reads `body --example: "changed"` (7.0s).
4. Click **Close dialog** (10.9s).

## Expected
The scroll-lock restore reverts only the body styles it set. `--example` stays `"changed"`.

## Actual
`--example` is cleared to an empty string after the close click (13.0s). The status box shows it as erased on dialog close. A failure banner reads `getPropertyValue('--example') === ""`, erased by scroll-lock restore (15.0s).

## Evidence
- 1.0s: baseline is `(not set)`.
- 7.0s: the property is set to `"changed"`. Setting it works.
- 13.0s: the status turns red with an empty value.
- 15.0s: the failure assertion banner appears.
- 21.0s: the dialog panel still shows "Dialog is open" in the frame after the close click.

## Suggested area
The Dialog scroll-lock cleanup on close. It probably overwrites or resets `body.style` as a whole instead of restoring only the individual properties it changed.

*Recorded with SceneRecap.*

This report was written by SceneRecap from a screen recording. Try SceneRecap free

Turn a screen recording into a bug report like this one.

Repro steps, expected vs actual and the console and network evidence, each with a timestamp. On every plan, Free included.

Try SceneRecap free →
Ariakit Dialog: closing dialog erases unrelated inline body styles (--example custom property cleared on close) · SceneRecap