gluestack-ui
gluestack-ui copied to clipboard
onKeyPress in <InputField /> triggers additional "Backspace" event after each key press (except for backspace itself)
Description
onKeyPress in <InputField /> should be triggered according to what you actually press, and backspace key shouldn't be triggered unless pressed
CodeSandbox/Snack link
No response
Steps to reproduce
Steps to reproduce:
Have following implementation:
<Input>
<InputField
onKeyPress={({nativeEvent}) => {
console.log(`InputField-onKeyPress: ${nativeEvent.key}`, { nativeEvent });
}}/>
</Input>
Case 1: Non backspace keys
- Type in "12ab" alphabets/number.
- Observe the log, there would be 8 logs (instead of 4), each keys were followed by a Backspace that you didn't pressed.
Case 2: Backspace key
- Now try press "Backspace" once.
- Observe the log, there's only one log from the backspace. Which is the expected behavior.
gluestack-ui Version
1.0.36
Platform
- [ ] Expo
- [X] React Native CLI
- [ ] Next
- [ ] Web
- [ ] Android
- [X] iOS
Other Platform
No response
Additional Information
Note: This has happened to me on iOS, I haven't tested on Android yet.
hi @chkee, I tried to reproduce the issue that you hae reported but it's working fine for me. I am sharing below the reference of my git repo https://github.com/rajat693/rn-inputBox
I am closing this issue for now. If you need further assistance or if the problem persists, please don’t hesitate to reopen it. Thank you!