change(ui): prevent player playing during editing of fields

This commit is contained in:
sylenien 2022-11-03 11:15:22 +01:00 committed by Delirium
parent fcf80e4b76
commit b129b526f3
3 changed files with 5 additions and 5 deletions

View file

@ -26,7 +26,7 @@ function PlayIconLayer({ playing, togglePlay, notesEdit }: Props) {
const getIsEdit = React.useCallback(() => notesEdit, [notesEdit])
const onKeyDown = (e: any) => {
if (getIsEdit()) return;
if (getIsEdit() || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return;
if (e.key === ' ') {
togglePlayAnimated();
}

View file

@ -10,7 +10,7 @@ export default (props: Props) => {
const { className = '', label = '', ...rest } = props;
return (
<label className={cn('flex items-center cursor-pointer', className)}>
<input type="checkbox" onChange={() => null} {...rest} />
<input type="checkbox" onChange={() => null} {...rest} />
{label && <span className="ml-2 select-none mb-0">{label}</span>}
</label>
);