TextView multiline - Enter button doesnt work - Android - Vue

uiux

#1

Hello everyone,

I have a little problem today, I want to make a multiline input field in a form.
For this, I use an editable TextView.

<TextView editable="true" hint="Some hint" />
<TextView editable="true" hint="Some hint" v-model="databindingvariable" />
<TextView editable="true" hint="Some hint" :text="databindingvariable" @textChange="onTextChange" />

THE PROBLEM IS :
When I push the “enter” button on my android keyboard, nothing happens, no newline.

  1. One of my solution was to add the onTextChange for see if something happens when the enter key is pressed, but nothing.

  2. I found this way interesting but doesnt work

returnPress Emitted when the return key is pressed.

Event is never emitted. I cannot add the “\n” manually with that

  1. Create a new way of adding a “\n” in the text.
    When there is 2 space, i do that,
onTextChange (text) {
            var tmp = this.databindingvariable;
            this.databindingvariable = tmp.replace("  ", "\n");
        }

Doesn’t work because the cursor go back to start, and it’s very annoying for user…

Actually I have no solution, I have to giveup my project with nativescript and to rewrite the whole shit on React Native :’(

Thanks for you help if you have a solution !

With love


#2

Just simple textview works for me.


#3

@manojdcoder
The field is multiline IF you write something until the end of the line (screen width)
BUT the ‘enter key’ doesn’t create a new line.

It doesn’t work so…
Who can help please ?


#4

The playground link simply works on my phone (Android 7.x), simply hitting enter works.

Please let us know which OS & Device you are testing it against.


#5

I’m working on an Samsung Galaxy J7 (2016) with Android 7.0

More important informations :

  • I use “npm run watch:android”, I just tried “npm run debug:android” and I get the same result
  • I try the playground with the playground app and preview app, and here the “enter key” works !

My NS version is : (in package.json)

  • ns-theme-core : 1.0.4
  • ns-vue : 1.3.1
  • tns-core-modules : 3.4.1 (EDIT : just updated to 4.2.0, and doesnt work…)

Thank you for your time !


#6

Since it’s only reproduced with your local code, would you mind uploading a sample to Github and share with us.


#7

The code is almost the same as the playground example.
In my last version, I copy paste the playground code (TextView line) for be sure, it was not my code.

https://pastebin.com/prQSuMD4

NB:
If you don’t want to lose your time, don’t worry, I think I’ll go back with a good and more mature React-Native (and I find a Vue-Native who seems better than nativescript-vue :confused: )