Skip to content
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

Add handlers for different events when you press keyboard button #714

Open
IslamRustamov opened this issue Sep 21, 2023 · 0 comments
Open

Comments

@IslamRustamov
Copy link

Introduction

In RN's TextInput we only have onChangeText prop, which is fired (for example, in Android) by ReactTextChangedEvent inside onTextChanged function of TextWatcher interface.

Details

There is a small problem with masking in "vanilla" RN, where you see that initially letter is inserted into input and only then mask applies, which causes "jumping". To solve this we might use 3rd party library or dig into native code ourselves and write patch.

Why won't we expose at least beforeTextChanged to also be invokable with some event (like ReactBeforeTextChangedEvent), so that we could workaround masking problem without 3rd party libraries?

Discussion points

  1. Why won't we expose other methods of TextWatcher interface to RN's TextInput?
  2. How could we implement proper masking without "jumping" in RN if we don't have an access to event "before" button was pressed?

P.S. I am willing to try out and implement it myself, to see whether it's actually going to solve the issue of masking and open a PR, if you are ok with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant