From 6f2bca76f277fca274afe38c8403a0aa3462c1e7 Mon Sep 17 00:00:00 2001 From: Jeremy Vercillo Date: Tue, 4 Nov 2025 16:17:51 -0500 Subject: [PATCH 1/2] Update shouldOnlyFireIfPressed for Windows platforms Currently in Windows platform I'm seeing a bug where invoking a Button via keyboard results in `onClick` being triggered twice, once from `onKeyUp` and once from `onKeyPressed`. This seemed like the appropriate place to make a fix, but let me know if there's a better place. --- packages/components/Button/src/useButton.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/Button/src/useButton.ts b/packages/components/Button/src/useButton.ts index 26f618a152..5d0d0cdca7 100644 --- a/packages/components/Button/src/useButton.ts +++ b/packages/components/Button/src/useButton.ts @@ -13,7 +13,7 @@ import type { ButtonProps, ButtonInfo } from './Button.types'; // like the button firing after you tab to it white Enter is pressed // and then releasing Enter, or the Menu reopening since it closes // onKeyDown while the Button operates onKeyUp. -const shouldOnlyFireIfPressed = Platform.OS === ('win32' as any); +const shouldOnlyFireIfPressed = Platform.OS === ('win32' as any) || Platform.OS === ('windows' as any); let isProcessingKeyboardInvocation = false; export const useButton = (props: ButtonProps): ButtonInfo => { From 1187d52186fdf1eb44ae18bb792786df13094c40 Mon Sep 17 00:00:00 2001 From: sprx97 Date: Tue, 4 Nov 2025 16:55:36 -0500 Subject: [PATCH 2/2] Change files --- ...native-button-05775eef-ba52-4258-b089-a2c1351a8382.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@fluentui-react-native-button-05775eef-ba52-4258-b089-a2c1351a8382.json diff --git a/change/@fluentui-react-native-button-05775eef-ba52-4258-b089-a2c1351a8382.json b/change/@fluentui-react-native-button-05775eef-ba52-4258-b089-a2c1351a8382.json new file mode 100644 index 0000000000..ca5e02467f --- /dev/null +++ b/change/@fluentui-react-native-button-05775eef-ba52-4258-b089-a2c1351a8382.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Update shouldOnlyFireIfPressed for Windows platforms", + "packageName": "@fluentui-react-native/button", + "email": "jeremy.vercillo@gmail.com", + "dependentChangeType": "patch" +}