Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnSubmitEditing fires at wrong time on TextInput #429

Closed
ospfranco opened this issue May 31, 2020 · 3 comments · Fixed by #442
Closed

OnSubmitEditing fires at wrong time on TextInput #429

ospfranco opened this issue May 31, 2020 · 3 comments · Fixed by #442

Comments

@ospfranco
Copy link

ospfranco commented May 31, 2020

Environment

System:
OS: macOS 10.15.5
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 2.21 GB / 32.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.2.0 - /usr/local/bin/node
Yarn: 1.22.0 - ~/.volta/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 27, 28, 29
Build Tools: 27.0.3, 28.0.3, 29.0.0
System Images: android-28 | Google Play Intel x86 Atom, android-R | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_212 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
npmGlobalPackages:
react-native: Not Found

Issue

When using TextInput field onSubmitEditing is being fired when pressing the backspace key

Steps to Reproduce

  1. Create the following component:
<TextInput
        placeholder="+ Add Entry..."
        onSubmitEditing={() => console.warn('onSubmitEditing fired')}
        multiline
        numberOfLines={10}
/>
  1. Start typing, when you press Cmd+Enter the onSubmitEditing function is called correctly
  2. Now press Delete key
  3. onSubmitEditing will also fire

Expected Behavior

expected onSubmitEditing to only fire when pressing the Enter key

@ghost ghost added the Needs: Triage 🔍 label May 31, 2020
@okwast
Copy link

okwast commented Jun 2, 2020

Hey, I also experience some issues with the TextInput.
When multiline is false it seems like onSubmitEditing is not called at all. At least I did not make it happen.
Neither with Enter nor CMD+Enter nor anything else.

With multiline enabled the TextInput seems to be completely broken.
It stops showing the input, but only shows the background and when typing there is some block spawning at the bottom of the window.
A bit hard to explain.

With empty input:
Screen Shot 2020-06-02 at 15 57 40

After typing asdf:
Screen Shot 2020-06-02 at 15 57 44

System info:

System:
OS: macOS 10.15.4
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 186.52 MB / 16.00 GB
Shell: 3.0.2 - /usr/local/bin/fish
Binaries:
Node: 14.1.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.8.4 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-28 | Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6392135
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_232 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
npmGlobalPackages:
react-native: Not Found

@tom-un
Copy link
Collaborator

tom-un commented Jun 9, 2020

Probably related to Issue #432
@tido64 FYI

@tido64
Copy link
Member

tido64 commented Jun 10, 2020

@okwast Can you create a new issue for us? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants