msyavuz commented on code in PR #43966:
URL: https://github.com/apache/superset/pull/43966#discussion_r3952207574
##########
superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx:
##########
@@ -328,6 +332,16 @@ export const DropdownContainer = forwardRef(
gap: ${theme.sizeUnit * 4}px;
margin-right: ${theme.sizeUnit * 4}px;
min-width: 0px;
+ /* Some browsers can paint the mid-remeasure frame where all
+ * items are mounted; clamp so it doesn't overflow the bar.
+ * !important so a consumer's style prop can't defeat it. */
+ ${
+ recalculating &&
+ css`
+ max-width: ${lastRowWidthRef.current}px !important;
Review Comment:
This clamps to the row's previous *content* width (the row is `flex: 0 1
auto`, so `lastRowWidthRef` is the sum of the previously visible items), and
the overflow index below is measured against that clamped
`container.getBoundingClientRect().right` while `recalculating` is true. So a
new item that would fit in the leftover space before the button gets pushed
into the dropdown, and the follow-up effect only preserves the index (`width >
previousWidth` is false), so it stays there until a window resize. Clamping to
the outer wrapper's width (the available width) instead would avoid that.
##########
superset-frontend/packages/superset-ui-core/src/components/DropdownContainer/DropdownContainer.tsx:
##########
@@ -179,6 +182,7 @@ export const DropdownContainer = forwardRef(
childrenArray.map(child => child.getBoundingClientRect().width),
);
} else {
+ lastRowWidthRef.current = container.getBoundingClientRect().width;
Review Comment:
Is the remeasure-with-clamp path testable with the existing setup, or is the
Edge repro the only coverage?
--
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]