diegomedina248 opened a new pull request, #20021: URL: https://github.com/apache/superset/pull/20021
### SUMMARY This error was detected on a particular dashboard, for a particular set of conditions and only in chrome. The truncation, in this case, refers to the right content of the `SCOPE` row. <img width="491" alt="Screen Shot 2022-05-11 at 01 12 00" src="https://user-images.githubusercontent.com/17252075/167767707-cc5461c1-91a1-4575-9fba-142c64ab7627.png"> The `useTruncate` function computes the truncated elements by trying to fit one element at a time in the with of their container. Problem is, by using this information to truncate the element, and add the `+X` next to it, we're changing the container size, thus triggering another pass at this function. This, in 99.9% of the cases is fine, but, in very subtle conditions, it can change the truncated count back and forth, if: * the size taken by the `+X` removes the space needed by the last visible element by 1 * the subtle size gain by the `+(X - 1)` tag makes enough room for the removed element to appear again. In this dashboard, the change was between +10 and +11, which has a very different pixel difference, but enough to cause the re-rendering loop. This PR ensures we only compute the truncated elements if their size changes, or if the size of the parent of the container changes. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF For the reasons specified above, and given that the dashboard has private data, no gif is available. Suffice to say, no change should be visible, the popup and truncation should remain the same for every other use case. ### TESTING INSTRUCTIONS Ensure that the native filters popup content displays correctly, and that the truncation still works as expected. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- 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]
