fix grid song play behavior (#1477)

This commit is contained in:
jeffvli
2026-01-01 12:41:02 -08:00
parent e5c5985f0f
commit 091d2efb2e
2 changed files with 45 additions and 8 deletions
@@ -73,6 +73,29 @@ const createPlayHandler =
return;
}
const isSongItem =
itemType === LibraryItem.SONG ||
itemType === LibraryItem.PLAYLIST_SONG ||
(item as { _itemType: LibraryItem })._itemType === LibraryItem.SONG;
if (isSongItem && controls?.onDoubleClick && internalState) {
const rowId = internalState.extractRowId(item);
if (rowId) {
const index = internalState.findItemIndex(rowId);
return controls.onDoubleClick({
event: null,
index,
internalState,
item,
itemType,
meta: {
playType,
},
});
}
}
controls?.onPlay?.({
event: e,
internalState,