-
Notifications
You must be signed in to change notification settings - Fork 88
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Setting direction prop makes dropdown not showing, because in AutocompleteDropdownContext direction is undefined.
In index.js direction sets from prop, but in AutocompleteDropdownContext direction is still undefined, because it not passes to context:
const {
content,
setContent,
activeInputRef,
direction = props.direction,
setDirection
} = useContext(AutocompleteDropdownContext)
Without direction prop it sets to context on open:
const open = async () => {
if (!props.direction) {
await calculateDirection()
}
setIsOpened(true)
}
That's why we need to call setDirection in both cases like this or something:
const open = async () => {
if (props.direction) {
setDirection(props.direction)
} else {
await calculateDirection()
}
setIsOpened(true)
}
tb-nishant, abhishekkumar1775 and onmotion
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working