-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor:
onChangeText
from delegate (#435)
## 📜 Description Consume `onChangeText` from delegate level. ## 💡 Motivation and Context To make some of functionality properly working in reach RN ecosystem you had to apply patch to `react-native-text-input-mask`. However it makes it complicated in terms of setup so I always thought on how to improve it. In #426 we started to inject our delegate to intercept some `TextInput` events. So now we can intercept necessary events without event-bus subscription (we can take them directly from the delegate). In this PR I re-worked this part (removed `TextInputObserver` class) and started to use delegate for these purposes. Also I've discovered again that we may substitute back delegate and then substitute our own again (when user typed first letter) - it's not critical but it doesn't comply with keyboard-controller delegate paradigm - we should set delegate only once (on focus) and unset it on un-focus. So I also re-worked this part and now, when we're trying to delete our observers - we check, that we are actually move focused to another input. ## 📢 Changelog ### Docs - removed **Known issues** from `useFocusedInputHandler` hook; ### E2E - compare text between `worklet` and `formatted`; ### iOS - substitute delegate only one time on focus; - handle text changes on delegate level; ## 🤔 How Has This Been Tested? Tested on CI and iPhone 15 Pro manually. ## 📸 Screenshots (if appropriate): No visual changes. ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
- Loading branch information
1 parent
f2ea4fe
commit 427c26c
Showing
7 changed files
with
59 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,7 +106,8 @@ | |
"xcworkspace", | ||
"ccache", | ||
"ivar", | ||
"objc" | ||
"objc", | ||
"QWERT" | ||
], | ||
"ignorePaths": [ | ||
"node_modules", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.