Giter Site home page Giter Site logo

onUpdate bug about react-panelgroup HOT 7 CLOSED

danfessler avatar danfessler commented on August 21, 2024
onUpdate bug

from react-panelgroup.

Comments (7)

DanFessler avatar DanFessler commented on August 21, 2024 1

Done. Closing issue

from react-panelgroup.

DanFessler avatar DanFessler commented on August 21, 2024

good catch. The intent was to pass out the panels object, yeah.

Related to this, when you update the props externally it's supposed to update the internal panels state in componentWillReceiveProps, but it's not making a correct props comparison so it wont work. I'll fix both of these issues.

from react-panelgroup.

TimNZ avatar TimNZ commented on August 21, 2024

Thanks Dan.

I want to do a mash up of your component and this: http://zippyui.com/docs/react-split-container.
I like it's open/close shortcut feature.

from react-panelgroup.

DanFessler avatar DanFessler commented on August 21, 2024

Pushed a fix.

To do what you want, maintain the panel widths in your container's state and supply it to the PanelGroup as a panelWidths prop. Stay in sync with the PanelGroup's internal state changes by supplying a hook to props.onUpdate that then updates your container's copy.

With that, you should be able to collapse a panel programmatically or whatever other special thing you want to do. I tested this scenario locally, but let me know if you get it working too.

from react-panelgroup.

TimNZ avatar TimNZ commented on August 21, 2024

Cheers bro, appreciate your time.

from react-panelgroup.

TimNZ avatar TimNZ commented on August 21, 2024

I'll make some modifications and submit a pull request if I decide to use it for the current project to incorporate more customisability.

Thanks again for it.

from react-panelgroup.

TimNZ avatar TimNZ commented on August 21, 2024

Can you please publish an update to npm.

from react-panelgroup.

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.