From 3807bbf6c143259d46cba52becf2c4f100fb6f69 Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Sat, 10 Apr 2021 00:10:38 +0100 Subject: [PATCH] Fix key repeats not flushing changes --- src/useEditable.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/useEditable.ts b/src/useEditable.ts index 224e239..1a1a776 100644 --- a/src/useEditable.ts +++ b/src/useEditable.ts @@ -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']) => {