fix: stop dblclk on play btn to trigger rename dlg

This commit is contained in:
Stefano Brilli 2021-07-30 16:23:39 +02:00
parent 2350d53107
commit b8b8f53528
1 changed files with 4 additions and 2 deletions

View File

@ -129,13 +129,14 @@ export function TrackRow({ track, inGroup, isSelected, draggableProvided, isCurr
const handleRename = useCallback(event => onRename(event, track.index), [track.index, onRename]);
const handleSelect = useCallback(event => onSelect(event, track.index), [track.index, onSelect]);
const handlePlay = useCallback(
const handlePlay: React.MouseEventHandler = useCallback(
event => {
event.stopPropagation();
onPlay(event, track.index);
event?.stopPropagation();
},
[track.index, onPlay]
);
const handleDoubleClickOnPlayButton: React.MouseEventHandler = useCallback(event => event.stopPropagation(), []);
return (
<TableRow
@ -158,6 +159,7 @@ export function TrackRow({ track, inGroup, isSelected, draggableProvided, isCurr
className={clsx(classes.controlButtonInTrackCommon, classes.playButtonInTrackList)}
size="small"
onClick={handlePlay}
onDoubleClick={handleDoubleClickOnPlayButton}
>
<PlayArrowIcon fontSize="inherit" />
</IconButton>