Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ios] text is reloaded when entering text view #8620

Closed
@dosomder

Description

@dosomder

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:
  • Cross-platform modules:
  • Android Runtime: 6.5.1
  • iOS Runtime: 6.5.1
  • Plugin(s):

Describe the bug
If you enter (focus) a text field, the ios variant will reload the text defined in the property. This is different behavior to the android version where this does not happen. Basically I am using both text and formattedText property of the text view. By pressing a button I am using the user input from text and adding some formatting to it. This works fine on Android. On iOS since both properties are set, every time the text view is focused, the text from formattedText is reloaded thus clearing the user input if the button was not pressed.

I don't see the point why this is implemented like this on iOS and I think it can be removed to match the behavior of Android. See https://github.com/NativeScript/NativeScript/blob/master/nativescript-core/ui/text-view/text-view.ios.ts#L33

To Reproduce

  1. Open the playground app
  2. Type something in the text view
  3. Close the text view
  4. Focus the text view again -> text from before disappears

Expected behavior
Try the same on Android -> text does not disappear

Sample project
https://play.nativescript.org/?template=play-vue&id=lVTKFT

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions