microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.33k stars 1.14k forks source link

Fabric TextInput submitKeyEvents don't work consistently (canary 776) #12776

Open chrisglein opened 8 months ago

chrisglein commented 8 months ago

Problem Description

https://github.com/microsoft/react-native-windows/assets/26607885/c7de9d5b-8b68-43ee-968f-3ea68292569e

https://github.com/microsoft/react-native-windows/assets/26607885/e1f32ba2-56f5-4fcb-adf1-1f2203354015

Steps To Reproduce

  1. Have a TextInput with submitKeyEvents={[{code:'Enter', shiftKey: false}]} (submit on enter, don't submit on shift+enter)
  2. Also hook onSubmitEditing
  3. Also multiline={true}
  4. Type, press enter... all is well (submits)
  5. Type, press shift+enter... all is well (does not submit)
  6. Type, press shift+enter... it submits (not disired)

Expected Results

Disabling shift+enter is consistent.

CLI version

13.0.0

Environment

info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.23660
  CPU: "(24) x64 AMD Ryzen Threadripper PRO 3945WX 12-Cores     "
  Memory: 48.92 GB / 63.86 GB
Binaries:
  Node:
    version: 18.16.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.19
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 9.5.1
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.19041.0
      - 10.0.22000.0
      - 10.0.22621.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.9.34616.47 (Visual Studio Community 2022)
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.0-nightly-20240115-0c7008f28
    wanted: 0.74.0-nightly-20240115-0c7008f28
  react-native-windows:
    installed: 0.0.0-canary.776
    wanted: ^0.0.0-canary.776
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Target Platform Version

None

Target Device(s)

No response

Visual Studio Version

Visual Studio 2022

Build Configuration

Debug

Snack, code example, screenshot, or link to a repository

https://github.com/chrisglein/artificial-chat/blob/fabric/src/Chat.tsx

TatianaKapos commented 5 months ago

After some initial debugging, it looks like the "getKey()" windows function is only returning the right information half of the time. Further debugging is needed to see if this only affect TextInput or if it's affecting the other components aswell