Skip to content

Check for ScrollView ancestor in KeyboardAwareScrollView #336

Closed
@kirillzyusko

Description

@kirillzyusko

Describe the bug

Right now if TextInput is not a child of KeyboardAwareScrollView and you touch it -> KeyboardAwareScrollView still will be scrolled 😲

Code snippet

You can use example app and just add a new TextInput below KeyboardAwareScrollView in hierarchy.

Repo for reproducing

You can use example app.

To Reproduce
Steps to reproduce the behavior:

  1. Add TextInput (shouldn't be a child of ScrollView) in KeyboardAwareScrollView example
  2. Click on new TextInput
  3. See that ScrollView gets scrolled

Expected behavior

ScrollView shouldn't be scrolled.

Smartphone (please complete the following information):

  • Desktop OS: MacOS 14.2.1
  • Device: iPhone 15 Pro
  • OS: iOS 17.2
  • RN version: 0.72.4
  • RN architecture: old
  • JS engine: Hermes
  • Library version: 1.10.2

Additional context

I think useReanimatedFocusedInput should return additional field like parentScrollViewTarget, and in maybeScroll we can compare, that parentScrollViewTarget===scrollViewTarget and do scroll only in this case.

Metadata

Metadata

Assignees

Labels

KeyboardAwareScrollView 📜Anything related to KeyboardAwareScrollView component🐛 bugSomething isn't working📚 componentsAnything related to the exported components of this library

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions