From e293edb069ade6b0652b6e5da2fb8952380b6616 Mon Sep 17 00:00:00 2001 From: Nitish Agarwal <1592163+nitishagar@users.noreply.github.com> Date: Mon, 17 Nov 2025 14:45:03 +0530 Subject: [PATCH] fix: normalize Unicode characters in paste modal for proper detection (#976) --- ui/src/components/popovers/PasteModal.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/components/popovers/PasteModal.tsx b/ui/src/components/popovers/PasteModal.tsx index ccc5d307..9bc122d5 100644 --- a/ui/src/components/popovers/PasteModal.tsx +++ b/ui/src/components/popovers/PasteModal.tsx @@ -66,7 +66,8 @@ export default function PasteModal() { const macroSteps: MacroStep[] = []; for (const char of text) { - const keyprops = selectedKeyboard.chars[char]; + const normalizedChar = char.normalize('NFC'); + const keyprops = selectedKeyboard.chars[normalizedChar]; if (!keyprops) continue; const { key, shift, altRight, deadKey, accentKey } = keyprops; @@ -164,7 +165,7 @@ export default function PasteModal() { ...new Set( // @ts-expect-error TS doesn't recognize Intl.Segmenter in some environments [...new Intl.Segmenter().segment(value)] - .map(x => x.segment) + .map(x => x.segment.normalize('NFC')) .filter(char => !selectedKeyboard.chars[char]), ), ];