How to adapt the dropdown content width to Dropdown Tigger? #1921
-
Hey 👋 I need help making the Dropdown Content width 100% of the Dropdown triggers width. I had looked over the documentation and couldn't find any example. The issue I am stuck at is that DropdownContent is wrapped with Reference Code: https://github.com/nightwatchjs/html-reporter/blob/d79abf669d22cac4baf97dc2c5c847b1f5072d04/src/components/EnvironmentDropdown/index.tsx |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @vaibhavsingh97, You can use The |
Beta Was this translation helpful? Give feedback.
Hi @vaibhavsingh97,
You can use
--radix-popper-anchor-width
to achieve this, but I think a dropdown isn't the best component here because I can see that you have a search inside the dropdown content and that will conflict with typeahead feature. So would I say a Popover is better here? because I can see too it has a chevron icon on the right and that would be the trigger but you want to position the content relative to theEnvironmentSelectorWrapper
andPopover
component exposes anAnchor
part to achieve that.The
--radix-popper-anchor-width
isn't documented as inSelect
as--radix-select-trigger-width
, so I don't know if using the css variable is recommended. Perhaps they have a good rea…