mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-26 18:27:09 +01:00
fix: ensure LibrarySelector dropdown refreshes on button close
Added refresh() call when closing the dropdown via button click to maintain consistency with the ClickAwayListener behavior. This ensures the UI updates properly regardless of how the dropdown is closed, fixing an inconsistent refresh behavior between different closing methods. The fix tracks the previous open state and calls refresh() only when the dropdown was open and is being closed by the button click.
This commit is contained in:
parent
a3281ca027
commit
6125a090ef
1 changed files with 5 additions and 0 deletions
|
|
@ -109,7 +109,12 @@ const LibrarySelector = () => {
|
|||
|
||||
const handleToggle = (event) => {
|
||||
setAnchorEl(event.currentTarget)
|
||||
const wasOpen = open
|
||||
setOpen(!open)
|
||||
// Refresh data when closing the dropdown
|
||||
if (wasOpen) {
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue