Git Product home page Git Product logo

Comments (6)

FrancescoCioria avatar FrancescoCioria commented on September 26, 2024 1

So basically, as you already said, overflow-x: hidden and overflow-y: scroll are enforced by autosize which also removes any overflow style.

The problem here is that overflow-y: scroll is needed by autosize to work correctly so it would be too risky to mess with it...

The easiest solution for you would be to programmatically add a class overflow-hidden-important when you set maxRows={1} and then, in the CSS, set .overflow-hidden-important { overflow: hidden !important }.

from react-autosize-textarea.

cecton avatar cecton commented on September 26, 2024

I just checked the code and apparently the overflow is handled by the lib autosize so I doubt there is a solution unless there is a parameter in autosize to override the scrollbar...

from react-autosize-textarea.

FrancescoCioria avatar FrancescoCioria commented on September 26, 2024

Hi @cecton ,

I'm building a component that is a one-line field. When it gets focus, I want this component to expand to its full size. When I leave, I want this component to get back to one-line only.

Can't you solve this by programmatically changing the prop "maxRows" from 1 to undefined when it gets focused and back to 1 when it gets blurred?

from react-autosize-textarea.

cecton avatar cecton commented on September 26, 2024

That's exactly what I do. When the maxRows is 1 the scroll bar appears.

from react-autosize-textarea.

FrancescoCioria avatar FrancescoCioria commented on September 26, 2024

Ok I reproduced it, I'll look into the code, it's weird that it's ignoring style={ overflow: 'hidden' }

from react-autosize-textarea.

cecton avatar cecton commented on September 26, 2024

Thanks! I think this will do the trick. Too bad there isn't a cleaner way...

from react-autosize-textarea.

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.