mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-08 03:12:24 +03:00
Fix context menu "display on hover" in playlists
This commit is contained in:
parent
35e4eec293
commit
14d7a69088
@ -70,7 +70,10 @@ export const SongDatagridRow = ({
|
|||||||
...rest
|
...rest
|
||||||
}) => {
|
}) => {
|
||||||
const [visible, setVisible] = useState(false)
|
const [visible, setVisible] = useState(false)
|
||||||
const childCount = children.filter((c) => isValidElement(c)).length
|
const fields = React.Children.toArray(children).filter((c) =>
|
||||||
|
isValidElement(c)
|
||||||
|
)
|
||||||
|
const childCount = fields.length
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{multiDisc && record.trackNumber === 1 && (
|
{multiDisc && record.trackNumber === 1 && (
|
||||||
@ -87,16 +90,12 @@ export const SongDatagridRow = ({
|
|||||||
onMouseLeave={() => setVisible(false)}
|
onMouseLeave={() => setVisible(false)}
|
||||||
{...rest}
|
{...rest}
|
||||||
>
|
>
|
||||||
{React.Children.map(
|
{fields.map((child, index) =>
|
||||||
children,
|
index < childCount - 1
|
||||||
(child, index) =>
|
|
||||||
child &&
|
|
||||||
isValidElement(child) &&
|
|
||||||
(index < childCount
|
|
||||||
? child
|
? child
|
||||||
: cloneElement(child, {
|
: cloneElement(child, {
|
||||||
visible: contextAlwaysVisible || visible,
|
visible: contextAlwaysVisible || visible,
|
||||||
}))
|
})
|
||||||
)}
|
)}
|
||||||
</DatagridRow>
|
</DatagridRow>
|
||||||
</>
|
</>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user