fix(ui-color-picker): fix popover scrolling + docs routing#2237
fix(ui-color-picker): fix popover scrolling + docs routing#2237
Conversation
|
9cd5c36 to
31f7770
Compare
Added historyApiFallback to webpack dev server config to properly handle client-side routing. Without this, refreshing the page on non-root routes would return 404 errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…port This fix ensures the ColorPicker popover displays properly and is scrollable when its content (ColorMixer, ColorPreset, ColorContrast) would exceed the available viewport space. Key improvements: - Calculate max height dynamically based on available viewport space - Support both upward and downward popover placement - Use double requestAnimationFrame to ensure accurate measurements after Emotion finishes injecting CSS-in-JS styles and child components complete their mount lifecycle - Add opacity transition to prevent visual jump when popover opens - Reset calculated height state on close to fix alternating open/close behavior - Add visual regression tests The double rAF approach was necessary because a single requestAnimationFrame was insufficient for the timing requirements of Emotion's dynamic style injection. The solution works reliably regardless of React StrictMode setting. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
31f7770 to
9e06ba2
Compare
ToMESSKa
left a comment
There was a problem hiding this comment.
If I open the ColorPicker, select a color and click 'Add' and then open the ColorPicker again, the viewport size is not respected and scrolling isn't avaliable.
HerrTopi
left a comment
There was a problem hiding this comment.
Lgtm. At least good enough. If you select a color and close the popover, it wont scroll if opened again. If closed and open again, it works as expected. Good for now
72150d8 to
73c4c6b
Compare
73c4c6b to
64c75dc
Compare
| cy.injectAxe() | ||
| // TODO: Fix ARIA violations before enabling a11y check | ||
| // - aria-allowed-attr (critical): 1 node | ||
| // - aria-prohibited-attr (serious): 3 nodes | ||
| // ColorMixer has aria-disabled on plain div without proper role | ||
| // cy.checkA11y('.axe-test', axeOptions, terminalLog) | ||
| }) |
There was a problem hiding this comment.
These issues existed before this PR, right? (I dont see them when I run in the example page with a ColorPicker open)
There was a problem hiding this comment.
i think they existed but we didn't have colorpicker examples before this pr
Fixed two issues with the ColorPicker mixer button: 1. Alignment calculation returning 0 due to timing - measurement now happens after CSS-in-JS styles are applied using requestAnimationFrame 2. Visual jump on load - button now starts bottom-aligned and switches to top-aligned after calculation completes, minimizing the jump 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
64c75dc to
32ddef6
Compare
@matyasf this should be fixed now |

Summary
Fixed multiple ColorPicker issues related to popover scrolling and mixer button alignment.
Issue 1: Popover Scrolling
Fixed ColorPicker popover scrolling when content exceeds viewport height. The popover now dynamically calculates available space based on placement (above/below trigger) and becomes scrollable when needed. A smooth fade-in transition prevents visual jump on opening.
Issue 2: Mixer Button Alignment
Fixed mixer button alignment and visual jump issues:
requestAnimationFrameto defer measurement until CSS-in-JS styles are appliedKey Changes
requestAnimationFramefor popover to wait for Emotion CSS-in-JS injection and child component mountingrequestAnimationFramefor mixer button alignment to wait for layout completionalignSelfswitching for mixer button to minimize visual jumpTest Plan
Refs INSTUI-4849
🤖 Generated with Claude Code