Skip to content

wip - [bugfix] Add dropdown scroll clipping regression test stories#3767

Draft
Myranae wants to merge 3 commits into
mainfrom
claude/nice-bohr-obi9j8
Draft

wip - [bugfix] Add dropdown scroll clipping regression test stories#3767
Myranae wants to merge 3 commits into
mainfrom
claude/nice-bohr-obi9j8

Conversation

@Myranae

@Myranae Myranae commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a comprehensive Storybook story file for testing and reproducing a reported iPad bug where the bottom-most dropdown in a multi-dropdown question fails to open when positioned near scroll container edges.

Changes

  • New file: packages/perseus/src/widgets/dropdown/__docs__/dropdown.scroll-clipping-regression.stories.tsx
    • Adds 7 test stories that reproduce various conditions triggering the scroll clipping bug
    • Includes detailed documentation of the suspected root cause (Popper's hide modifier hiding menus when openers escape clipping ancestors)
    • Provides helper components (ScrollClip, ZoomWrapper) to simulate the conditions present on iOS devices

Key Stories

  1. LastDropdownNearScrollEdge - Four dropdowns in a short scrollable container
  2. LastDropdownInOverflowHidden - Same content with overflow: hidden clipping
  3. ManyDropdownsTightClip - Eight dropdowns in a very tight container
  4. ZoomedExercise - Dropdowns inside a transform: scale() ancestor (mimics pinch-zoom)
  5. ZoomedInsideScrollClip - Combined zoom + scroll clipping scenario
  6. ZoomAfterOpening - Demonstrates menu detachment when transform is applied after opening
  7. NoClippingControl - Baseline control with no clipping or zoom

Implementation Details

  • Uses test data generators from @khanacademy/perseus-core to build multi-dropdown questions
  • Includes play functions that automatically scroll the last dropdown into view and open it
  • Provides inspection guidance in comments for identifying when the bug is reproduced (checking for visibility: hidden on the portaled menu element)
  • Configured with disableSnapshot: true to prevent Chromatic snapshot testing
  • Uses mobile API options to test the mobile rendering path

https://claude.ai/code/session_01DaWpCJGeZDy6ucro6JSEUA

claude added 2 commits June 11, 2026 15:56
Repro harness for the iPad bug where the bottom-most of several inline
dropdowns fails to open. Covers multiple inline dropdowns inside clipped
scroll containers and under CSS transform scale, plus a zoom-after-open
story that demonstrates the menu detaching from its opener.

https://claude.ai/code/session_01DaWpCJGeZDy6ucro6JSEUA
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 508 kB

ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.6 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 6.32 kB
packages/math-input/dist/es/index.js 98.5 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.item-splitting.js 12 kB
packages/perseus-core/dist/es/index.js 26.3 kB
packages/perseus-editor/dist/es/index.js 105 kB
packages/perseus-linter/dist/es/index.js 9.8 kB
packages/perseus-score/dist/es/index.js 10.2 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/index.js 200 kB
packages/perseus/dist/es/strings.js 8.6 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.71 kB

compressed-size-action

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (7260cc3) and published it to npm. You
can install it using the tag PR3767.

Example:

pnpm add @khanacademy/perseus@PR3767

If you are working in Khan Academy's frontend, you can run the below command.

./dev/tools/bump_perseus_version.ts -t PR3767

If you are working in Khan Academy's webapp, you can run the below command.

./dev/tools/bump_perseus_version.js -t PR3767

@Myranae Myranae changed the title Add dropdown scroll clipping regression test stories wip - [bugfix] Add dropdown scroll clipping regression test stories Jun 12, 2026
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.

2 participants