Commit ecd3bbd
authored
fix: could not fing view for tag warning (#1379)
## 📜 Description
Silent `could not fing view for tag` warning for
`KeyboardAwareScrollView` (similarly how it works for
`KeyboardAvoidingView` now).
## 💡 Motivation and Context
This issue got introduced after
#1352
(which was based on
#1346)
In certain cases `onLayout` may be triggered but view may be not laid
out yet (if you use it with `react-native-pager` lazy). Since changes in
#1352
were purely additional (we try to understand the position of element on
the screen, but before these changes we always assumed we were in the
top of the screen) I decided to wrap it for now in `try/catch` block.
Silenting error is not a correct fix, but this is the best what we can
do now - we will not spam logs when devs update the package (in
#1346
we also used `catch` block), but yes, in certain cases detection of top
border will not work (and it didn't work before, so it's fair enough to
silent the error).
Closes
#1375
## 📢 Changelog
<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->
### JS
- handle rejected promises within `try/catch` block;
## 🤔 How Has This Been Tested?
Tested via e2e tests, I didn't test changes manually because I don't
have a repro.
## 📝 Checklist
- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed1 parent 38cdb43 commit ecd3bbd
1 file changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
172 | 176 | | |
173 | 177 | | |
174 | 178 | | |
| |||
0 commit comments