From 8e7ec01e281188b9e7aca57c8eeb3c0b95a6ced8 Mon Sep 17 00:00:00 2001 From: EthanShoeDev <13422990+EthanShoeDev@users.noreply.github.com> Date: Tue, 7 Oct 2025 01:24:15 -0400 Subject: [PATCH] small bug fix --- apps/mobile/src/app/(tabs)/shell/detail.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/mobile/src/app/(tabs)/shell/detail.tsx b/apps/mobile/src/app/(tabs)/shell/detail.tsx index 989e0a2..65151d1 100644 --- a/apps/mobile/src/app/(tabs)/shell/detail.tsx +++ b/apps/mobile/src/app/(tabs)/shell/detail.tsx @@ -467,6 +467,9 @@ type KeyboardToolbarButtonProps = | KeyboardToolbarModifierButtonProps | KeyboardToolbarInstantButtonProps; +const propsToKey = (props: KeyboardToolbarButtonProps) => + 'label' in props ? props.label : props.iconName; + function KeyboardToolbarButton({ style, ...props @@ -487,7 +490,8 @@ function KeyboardToolbarButton({ ); const modifierActive = - props.type === 'modifier' && modifierKeysActive.includes(props); + props.type === 'modifier' && + !!modifierKeysActive.find((m) => propsToKey(m) === propsToKey(props)); return ( { if (props.type === 'modifier') { setModifierKeysActive((modifierKeysActive) => - modifierKeysActive.includes(props) - ? modifierKeysActive.filter((m) => m !== props) + modifierKeysActive.find((m) => propsToKey(m) === propsToKey(props)) + ? modifierKeysActive.filter( + (m) => propsToKey(m) !== propsToKey(props), + ) : [...modifierKeysActive, props], ); return;