NativeScript icon indicating copy to clipboard operation
NativeScript copied to clipboard

TextField with [secure] string don't work on Android with core plugin 8.6.2

Open Dzenan-Fatkic opened this issue 1 year ago • 1 comments

Issue Description

I have a TextField for a login and registration service in my Application. We are using the [secure] function from the TextField for the password input. In the version of @nativescript/core 8.6.2 occurs a bug for Android (API Range 26-34). When you change the [secure] vaule by runtime on android the input will not be visibile.

The version 8.6.1 don't have this bug.

Reproduction

The source code of our company application is not public. But you can check this with a simple TextField using [secure]="BooleanVariable"

Relevant log output (if applicable)

No response

Environment

No response

Please accept these terms

Dzenan-Fatkic avatar Jan 30 '24 13:01 Dzenan-Fatkic

8.6.2 truly contains changes related to TextField but we'll need more information, like the previous and new boolean value or whether problem occurs both ways (true <-> false). Also, does the textfield have any other attributes? A stackblitz sample that replicates this would also be helpful.

EDITED: I failed to reproduce it with an API 29 device so I think we'll need that reproducible sample.

CatchABus avatar Jan 30 '24 14:01 CatchABus

In version 8.6.5 the problem persists on Android. If you change 'secure' from true to false the text is not displayed. If the initial state is true and you change it to false, it works but changes the font type and the cursor moves to the beginning of the text.

ignacio68 avatar Mar 21 '24 16:03 ignacio68

In version 8.6.5 the problem persists on Android. If you change 'secure' from true to false the text is not displayed. If the initial state is true and you change it to false, it works but changes the font type and the cursor moves to the beginning of the text.

I have the same problem :(

Bezlepkin avatar Apr 11 '24 10:04 Bezlepkin

@ignacio68 @Bezlepkin Can you please post a reproducible sample? Stackblitz or repo will do.

CatchABus avatar Apr 11 '24 10:04 CatchABus

@ignacio68 @Bezlepkin Can you please post a reproducible sample? Stackblitz or repo will do.

https://stackblitz.com/edit/nativescript-stackblitz-templates-eod1hz?file=app%2Fcomponents%2FHome.vue

Bezlepkin avatar Apr 11 '24 11:04 Bezlepkin

The bug is reproduced exactly if you set: keyboardType="number"

Bezlepkin avatar Apr 11 '24 11:04 Bezlepkin

If I comment out this line: https://github.com/NativeScript/NativeScript/blob/main/packages/core/ui/text-field/index.android.ts#L115 everything works :)

Bezlepkin avatar Apr 11 '24 11:04 Bezlepkin

If I comment out this line: https://github.com/NativeScript/NativeScript/blob/main/packages/core/ui/text-field/index.android.ts#L115 everything works :)

This one is needed to fix another problem just as described in the comment. I'll try to reproduce it with your sample. I'd like us to keep the benefits of those changes and solve the problem described. Worse case scenario, we'll revert the changes that caused this.

CatchABus avatar Apr 11 '24 12:04 CatchABus

@Bezlepkin Can you try without a keyboard type?

CatchABus avatar Apr 11 '24 12:04 CatchABus

@Bezlepkin Can you try without a keyboard type?

Without specifying keyboardType, it works correctly

Bezlepkin avatar Apr 11 '24 13:04 Bezlepkin