Skip to content

fix: could not fing view for tag warning#1379

Merged
kirillzyusko merged 1 commit intomainfrom
fix/could-not-fing-view-for-tag-warning
Mar 18, 2026
Merged

fix: could not fing view for tag warning#1379
kirillzyusko merged 1 commit intomainfrom
fix/could-not-fing-view-for-tag-warning

Conversation

@kirillzyusko
Copy link
Copy Markdown
Owner

@kirillzyusko kirillzyusko commented Mar 18, 2026

📜 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

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

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko self-assigned this Mar 18, 2026
@kirillzyusko kirillzyusko added 🐛 bug Something isn't working KeyboardAwareScrollView 📜 Anything related to KeyboardAwareScrollView component labels Mar 18, 2026
@kirillzyusko kirillzyusko force-pushed the fix/could-not-fing-view-for-tag-warning branch from dda1790 to d74f3c8 Compare March 18, 2026 12:11
@kirillzyusko kirillzyusko changed the title Fix/could not fing view for tag warning fix: could not fing view for tag warning Mar 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📊 Package size report

Current size Target Size Difference
306909 bytes 306781 bytes 128 bytes 📈

@github-actions
Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://kirillzyusko.github.io/react-native-keyboard-controller/pr-preview/pr-1379/

Built to branch gh-pages at 2026-03-18 12:12 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented Mar 18, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Mar 18, 2026, 12:14 PM

@kirillzyusko kirillzyusko marked this pull request as ready for review March 18, 2026 16:47
@kirillzyusko kirillzyusko merged commit ecd3bbd into main Mar 18, 2026
14 of 16 checks passed
@kirillzyusko kirillzyusko deleted the fix/could-not-fing-view-for-tag-warning branch March 18, 2026 16:47
@Junveloper
Copy link
Copy Markdown

This was tearing my hair out! After seeing your tweet, I've updated to 1.21 to implement chat and whoa I thought I did something!! So glad I checked the PR! Thank you as always.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working KeyboardAwareScrollView 📜 Anything related to KeyboardAwareScrollView component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeyboardAwareScrollView causes 'Could not find view for tag' errors in v1.21.0

2 participants