fix: Improve consistency of Popover --trigger-width#9913
Conversation
|
Build successful! 🎉 |
|
@snowystinger Linking #7663 (comment) here, since I had previously addressed these issues. Did anything change as far as the original concerns go? |
|
@nwidynski not sure I understand the concern. The PR you linked to is setting |
|
It was more so directed towards the comment about adding a resize observer on every popover mount. I'm not too concerned personally about the performance of that, but linked it since it was mentioned. Regarding the styling though, I'm not sure I follow why |
|
Oh. I actually think the performance might be better than before. Previously the resize observer would be active even when the popover was not open since it lived within the trigger. Now it only measures when the popover first opens. re. minWidth I think the concern before was that setting a default minWidth via inline styles would override the user's css. doing it via a var is opt-in. nothing is really changing there. |
Closes #9451, closes #5331
Updates the behavior of the Popover
--trigger-widthCSS variable so it works consistently. Instead of being set by each trigger component, it is now set withinPopover. This means:triggerRefprop in case positioning is re-targeted--trigger-widthincorrect if ComboxBox inside Modal #5331)In addition, for ComboBox, we now position relative to the
<Group>element wrapping the input and button, instead of trying to measure both and find the union of their bounding boxes. This provides better default behavior, especially in cases like multi-select ComboBoxes which also add a TagGroup to display the selected items. Previously the menu would move to be positioned near the input rather than the visual grouping around everything. If a Group is not rendered, we fall back to the old behavior.