NativeScript / NativeScript/NativeScript

TextField's editable property doesn't behave as expected

Open
#6,899 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog bug
Dominant language
TypeScript
Stars
25.7k
Forks
1.7k
Avg merge
1d 5h
Merged PRs (30d)
35

Description

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.1
  • Cross-platform modules: 5.1
  • Android Runtime: 5.1
  • iOS Runtime: 5.1
  • Plugin(s): 5.1

Describe the bug
I have a TextField with editable set to false. However if I tap quickly on the field while the app is resuming, I can change the text.

To Reproduce
Run this playground on iOS. Tap on any of the fields. Keyboard doesn't show (as expected). Minimise the app and then get back to it. Don't wait for it to fully load, tap quickly on some of the fields. You can now change the text.

Expected behavior
You should not be able to change the text.

Sample project
Here is the sample playground

Additional context
I believe the nativeView's delegate should be updated in initNativeView/disposeNativeView instead of in onLoaded/onUnloaded as it is now.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read tns-core-modules/ui/text-field/text-field.ios.ts around line 168, then reproduce the resume-and-tap sequence with the linked Playground on iOS. Compare the editable behavior during normal loading and app resumption; done means a non-editable TextField cannot be changed in either state.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, typescript
Domain
frontend, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.