You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try to comment the 33rd line and uncomment the 34th line.
as you can see, whenever style prop is function then --trigger-width is not passed to the popover
Version
latest
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
MacOS
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered:
6thpath
changed the title
RAC Popover width
RAC Popover style inside Select & ComboBox does not works properly
Apr 24, 2024
6thpath
changed the title
RAC Popover style inside Select & ComboBox does not works properly
[RAC] Popover style inside Select & ComboBox does not works properly
Apr 24, 2024
I did some digging, and it looks like the root cause of this is the fact that useContextProps() will merge contextProps and props only when both of them are of type object:
Since the above condition is not met when a user provides their style as a function, it resorts to the default merging strategy of mergeProps(contextProps, props), which is to select the value of the last argument (in our case, props over contextProps:
So that's why the contextProps passed by Combobox that contains style: {'--trigger-width': menuWidth} is overwritten by the user provided style={() => ({ background: "red" })}.
Provide a general summary of the issue here
when using
Select
orComboBox
component, passing style as function toPopover
component would make--trigger-width
style property is unavailable🤔 Expected Behavior?
Popover
insideSelect
&ComboBox
also receive--trigger-width
even ifstyle
is specified as a function😯 Current Behavior
--trigger-width
is not passed toPopover
when style is passed to component as a function💁 Possible Solution
No response
🔦 Context
No response
🖥️ Steps to Reproduce
https://codesandbox.io/p/sandbox/racpopover-lfv6dt
try to comment the 33rd line and uncomment the 34th line.
as you can see, whenever style prop is function then
--trigger-width
is not passed to the popoverVersion
latest
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
MacOS
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: