EnxDev commented on PR #43966: URL: https://github.com/apache/superset/pull/43966#issuecomment-5585090292
Both review comments addressed in 2f71175a17. **`width` defaults to `0` until the first ResizeObserver callback** (`DropdownContainer.tsx` L338) Fixed. The clamp now falls back to the consumer's value while the wrapper is unmeasured: ```ts maxWidth: width || style?.maxWidth, ``` So the pre-measurement frame is left as the consumer styled it instead of collapsing to `0px`. Added a regression test: with `useResizeDetector` reporting `width: 0`, the all-items frame keeps `max-width: none` rather than clamping. It fails if the guard is removed. **The row's `right` was 250 whether or not it was clamped** (`DropdownContainer.test.tsx` L204) You were right that the old assertion only proved the inline style was present at measure time. Reworked the mock so the row's rect is derived from its own content extent, bounded by its inline `max-width` when that is a pixel value. The 4-item row is 400px of content, so the measured edge is 300px when the clamp applies and 400px when it does not, and the test asserts the clamped edge is what the overflow index is computed against. Removing the clamp from the component now fails the test. On `min(content, wrapper - button)`: that models the bound the flex layout would apply, which is exactly the bound Edge fails to apply in the frame this PR is about. Baking it into the mock makes the row rect independent of the fix, so the clamp becomes a no-op in the test and it proves nothing either way. The mock now models the frame where the flex bound is missing, which is the only frame where the clamp does any work. `DropdownContainer` suite: 16/16 passing. Pre-commit clean. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
