Giter Club home page Giter Club logo

react-css-collapse's Issues

Possibility to specify CSS transition as component property

Thank you for this component. It work's quite well :).

However, I have an idea for improvement: Right now it is required to specify the className to set the desired CSS transition. While this might be fine for most use cases, because most people should have some kind of CSS-in-JS solution or a bundler in use anyway, it is also somewhat limiting. In my opinion it would be very handy, if the transition could also be set directly as Component property. This way users are not forced to use some library to inject the styles into the HTML or to do this manually.

Example:

<Collapse isOpen={isOpen} transition="height 250ms cubic-bezier(.4, 0, .2, 1)">
   <div>foo</div>
</Collapse>

Moreover it might be a good idea to offer a reasonable default transition (could be the default value of this potentially new component property). I was confused first, because the element collapsed without an animation. I think you should make it clearer in the README, that it is required to define a CSS transition first to make the animation work.

ComponentWillReceiveProps warning after upgrade to React 16.9.0

After upgrade to React 16.9.0, React prints console warning because react-css-collapse still uses componentWillReceiveProps life-cycle method. This method will be removed in React 17.0.0.
Would you please rewrite the code to make it work after React 17.0.0 release?
Thank you!

TypeError: null is not an object (evaluating 'this.content.style')

I'm not sure what is causing this issue specifically only that it happens sporadically.

stacktrace:

webpack:///~/react-css-collapse/lib/components/Collapse.js:99setContentStyleProperty

  }, {
    key: 'setContentStyleProperty',
    value: function setContentStyleProperty(property, value) {
      this.content.style[property] = value;
    }
  }, {
    key: 'setCollapsed',

webpack:///~/react-css-collapse/lib/components/Collapse.js:104setCollapsed

}, {
   key: 'setCollapsed',
   value: function setCollapsed() {
     this.setContentStyleProperty('height', '0px');
     this.setContentStyleProperty('overflow', 'hidden');
   }
 }, {

`overflow: hidden` should be removed after initial render when `isOpen={true}`

First off thanks for this component โ€“ came in handy in a pinch.

I have children components that have dropdowns that might spill over beyond the <Collapse /> parent component's height. The problem I'm encountering only happens when the initial render has isOpen={true}.

The inline style overflow: hidden is applied and remains on the component until you switch the state from isOpen={false}. In fact, once you toggle it yet again to isOpen={true} after being in the isOpen={false} state it does remove the overflow: hidden style with overflow: visible, which is what my child components require after the animation is complete.

Create a CONTRIBUTE document

The repo should have a contribute document documenting how one should contribute to this projects. PRs, tests, etc.

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.