Skip to content

fix(Flyout): keep content expanded on small screens with the active class - #1347

Open
Ultranmus wants to merge 1 commit into
ClickHouse:mainfrom
Ultranmus:fix-flyout-active-class
Open

Ultranmus wants to merge 1 commit into
ClickHouse:mainfrom
Ultranmus:fix-flyout-active-class

Conversation

@Ultranmus

@Ultranmus Ultranmus commented Dec 2, 2026 •

Copy link
Copy Markdown

Description

Under 1024px an open Flyout.Content slides in until only 50px show, and expands on hover or focus inside. Up to 0.6.1 you could keep it expanded by passing className="active". Since the CSS Modules migration (#1104) the .active selector gets hashed, so a plain active class from the consumer matches nothing and the Flyout stays a 50px strip on touch screens.

  • Match the consumer's class with :global(.active) for both align="start" and align="end", same as before 0.7.0
  • Add a Playwright test at 390px: the Flyout collapses without hover or focus, and expands once it has the active class

Links and tickets

Fixes #1341

Good to know

  • Stylelint doesn't know :global, so both lines have a stylelint-disable-next-line with a reason.
  • This restores the old behavior without adding an API. The issue also suggests following data-state="open", but the content is only mounted while open, so that would drop the 50px collapse entirely. Happy to switch if that's the preferred direction.

Checklist

  • Breaking changes? (add migration notes in changesets)
  • Visual changes? (specify in changesets)
  • Design review needed?

Contribution

  • Sufficient research before PR
  • Self-reviewed the PR
  • Manually tested the changes (when applies - visual confirmation in Storybook)
  • build and build-storybook work locally
  • Tests and Stories are aligned with the changes

Accessibility

  • Keyboard - no change to keyboard behavior; opening with Enter and keeping focus on the trigger now shows the full Flyout when active is set
  • Names — no markup changes
  • Vision — no color or token changes

Screenshots

At 390px with active on the content: before, only the 50px strip shows; after, the full Flyout shows. The new test in tests/display/flyout.spec.ts checks the content position before and after adding the class.

Tested: the new test fails on main and passes with the fix; yarn typecheck, lint, format, circular-dependency:check, test, build and storybook:build pass. I didn't run the Docker screenshot specs locally; they use a 1280px viewport where this rule doesn't apply.


Note

Low Risk
Narrow CSS selector fix in a responsive media query plus a regression test; no API or auth/data impact.

Overview
Restores pre–0.7.0 behavior where Flyout.Content stays fully visible below 1024px when consumers add a plain active class, instead of collapsing to the 50px peek strip until hover or focus.

After the CSS Modules migration, scoped selectors stopped matching consumer className="active". The small-screen expand rules now use :global(.active) for both align="start" and align="end", with stylelint disables for that pseudo.

A Playwright case at 390px asserts the dialog sits off-screen when collapsed and snaps to x = 0 after active is applied. A patch changeset documents the visual fix (Fixes #1341).

Reviewed by Cursor Bugbot for commit 2e7b4ab. Bugbot is set up for automated code reviews on this repo. Configure here.

…lass

Since the CSS Modules migration the .active selector is hashed, so a
consumer's plain active class no longer keeps an open Flyout expanded
under 1024px. Match it with :global(.active) like before 0.7.0.

Fixes ClickHouse#1341
@changeset-bot

changeset-bot Bot commented Dec 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2e7b4ab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clickhouse/click-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Open Flyout shows only 50px under 1024px without hover or focus

1 participant