Skip to content

fix(android): crash with material components #10450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 20, 2023
Merged

Conversation

farfromrefug
Copy link
Collaborator

setSecureAndKeyboardType needs to use nativeTextViewProtected As a reminder in text base components there is nativeViewProtected and nativeTextViewProtected. The reason is that material components (and maybe other) differentiate the layout and the textfield itself inside one view. A while back i made a PR for the whole N to support those two getters. But we need to remain careful on which one we use everytime

PR Checklist

What is the current behavior?

What is the new behavior?

Fixes/Implements/Closes #[Issue Number].

`setSecureAndKeyboardType` needs to use `nativeTextViewProtected` 
As a reminder in text base components there is `nativeViewProtected` and `nativeTextViewProtected`.
The reason is that material components (and maybe other) differentiate the layout and the textfield itself inside one view.
A while back i made a PR for the whole N to support those two getters. But we need to remain careful on which one we use everytime
Copy link
Contributor

@CatchABus CatchABus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree we should be more careful and stick to it.
Since we're doing this, I found few more references that could be corrected: https://github.com/NativeScript/NativeScript/blob/main/packages/core/ui/text-base/index.android.ts#L508

@farfromrefug
Copy link
Collaborator Author

@CatchABus actually this case does not matters a lot as setTextStroke is a method of the custom component used for label. dont think we use it for textfield though. might even crash with N textfield. we should check for method existence

@NathanWalker NathanWalker merged commit c5561d6 into main Dec 20, 2023
@NathanWalker NathanWalker deleted the farfromrefug-patch-1 branch December 20, 2023 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants