Can i know the menu placement open when i set menuPlacement="auto" #216
Replies: 1 comment
-
The prop First, you can use the const selectComponents = {
Menu: (props) => (
<chakraComponents.Menu
className={`menuPlacement-${props.placement}`}
{...props}
/>
),
};
const App = () => (
<Select
menuPlacement="auto"
className="chakra-react-select"
classNamePrefix="chakra-react-select"
components={selectComponents}
/>
); This might be what you want, but the class won't be available at the top level, only at the Another place you could access the const App = () => {
return (
<Select
chakraStyles={{
menu: (provided, selectProps) => {
console.log(selectProps.placement);
return provided;
},
}}
/>
);
}; If neither of these help with what you're trying to do, then give me more specifics and I can try and help further. Here's a CodeSandbox example including both: https://codesandbox.io/s/epcms4?file=/app.tsx |
Beta Was this translation helpful? Give feedback.
-
is there any props that tell me where is the menuPlacement top or bottom. ? can we add a className on the top dev like menuPlacement-top or menuPlacement-bottom for each option. ?
Beta Was this translation helpful? Give feedback.
All reactions