Button inside MenuTrigger keeps data-pressed="true" attribute when Popover is controlled #5765
Answered
by
reidbarber
janvorwerk
asked this question in
Q&A
-
Hello, I just discovered React Aria and its components 🚀 I just noticed a weird behavior, when I use a button as menu trigger of a controlled popover: the button state keeps the Something like that: const [isMenuOpen, setMenuOpen] = useState(false);
...
<MenuTrigger>
<Button variant="primary" onPress={() => setMenuOpen(true)}>
Filter
</Button>
<Popover className="min-w-[150px]" isOpen={isMenuOpen} onOpenChange={setMenuOpen}>
<Menu
onAction={onMenuAction}
selectionMode="multiple"
onSelectionChange={onFilterSelectionChange}
selectedKeys={shownFilters}
> The behavior is the same on all tested browsers: Chrome, Safari, Firefox, Edge. Any clue why? Should I file an issue? Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
reidbarber
Jan 29, 2024
Replies: 1 comment 2 replies
-
I don't think this is related to it being controlled, but it does seem like incorrect behavior. Feel free to create an issue so this can be investigated further! |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
janvorwerk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't think this is related to it being controlled, but it does seem like incorrect behavior. Feel free to create an issue so this can be investigated further!