From c7be66173a5a08ae51f8a30c8d5d8d9e292c7698 Mon Sep 17 00:00:00 2001 From: TheoryOfNekomata Date: Sat, 8 Aug 2020 20:22:28 +0800 Subject: [PATCH] Add width dependency This is to cover repainting of keys using the widths. --- src/components/Keyboard/Keyboard.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Keyboard/Keyboard.tsx b/src/components/Keyboard/Keyboard.tsx index b094923..232a58b 100644 --- a/src/components/Keyboard/Keyboard.tsx +++ b/src/components/Keyboard/Keyboard.tsx @@ -82,8 +82,8 @@ const Keyboard: React.FC = ({ const { natural: NaturalKey = DefaultNaturalKey, accidental: AccidentalKey = DefaultAccidentalKey } = keyComponents! - const getKeyWidth = React.useCallback((k) => getKeyWidthUnmemoized(startKey, endKey)(k), [startKey, endKey]) - const getKeyLeft = React.useCallback((k) => getKeyLeftUnmemoized(startKey, endKey)(k), [startKey, endKey]) + const getKeyWidth = React.useCallback((k) => getKeyWidthUnmemoized(startKey, endKey)(k), [startKey, endKey, width]) + const getKeyLeft = React.useCallback((k) => getKeyLeftUnmemoized(startKey, endKey)(k), [startKey, endKey, width]) const isNaturalKey = React.useCallback((k) => isNaturalKeyUnmemoized(k), []) React.useEffect(() => {