Coder Social home page Coder Social logo

Comments (3)

artald avatar artald commented on July 18, 2024

This behavior is not specific for this package.

AutoGrowTextInput is just a multi-line TextInput. Multi-line TextInput has an inner scroll container.

Using a ScrollView within a ScrollView is a problematic layout when they are both scrolling in the same direction.

One possible solution would be to let theAutoGrowTextInput extend its height indefinitely by setting the maxHeight prop to a really large number. I think that this way it won't have an inner scroll because then it will take the actual height and make the scroll content larger as well.
Another option could be to disable scrolling when necessary.

from react-native-autogrow-textinput.

VictorVarghese avatar VictorVarghese commented on July 18, 2024

Maanged to disable the scroll by commenting the android specific code in onContentChange()
Now scroll is disabled in textinput and works properly .Thanks for the awseome lib.

_onContentSizeChange(event) {
  /*  if(ANDROID_PLATFORM) {
     if(!this.state.androidFirstContentSizeChange) {
       return;
     }
     this.setState({androidFirstContentSizeChange: false});
   } */
   this._handleNativeEvent(event.nativeEvent);

   if (this.props.onContentSizeChange) {
     this.props.onContentSizeChange(event);
   }
 }

from react-native-autogrow-textinput.

artald avatar artald commented on July 18, 2024

@VictorVarghese thanks!

This code is there to fix a very specific bug on Android (see the comment above the _onContentSizeChange method). It's possible that this was fixed in more advanced RN versions that came after this fix was applied.

That said, I don't see how this help to disable scrolling. what's the idea here?

from react-native-autogrow-textinput.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.