NativeScript / NativeScript/NativeScript
TextField blur firing multiple times when pressing return key (iOS)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 25.7k
- Forks
- 1.7k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 35
Description
TextField blur is firing multiple times when pressing the return button on the keyboard. In the source, this seems to be because both 'textFieldDidEndEditing' and 'textFieldShouldReturn' call 'dismissSoftInput.' Each time 'dismissSoftInput' is called, it fires a blur event whether the UITextField was the firstResponder or not.
When hitting the 'return' key, the blur should only be called once.
(Something similar happens on Android, but for other reasons ( #5820 ))
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the iOS TextField implementation around textFieldDidEndEditing and textFieldShouldReturn, then inspect how dismissSoftInput emits blur events. Done means pressing the Return key produces exactly one blur event instead of multiple events.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100