Skip to content

Commit

Permalink
Fix key repeats not flushing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Apr 9, 2021
1 parent cdd4ba2 commit 3807bbf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/useEditable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ export const useEditable = (
: content.slice(0, start) + '\t' + content.slice(start);
edit.update(newContent);
}

// Flush changes as a key is held so the app can catch up
if (event.repeat) flushChanges();
};

const onKeyUp = (event: HTMLElementEventMap['keyup']) => {
Expand Down

0 comments on commit 3807bbf

Please sign in to comment.