Code Monkey home page Code Monkey logo

Comments (9)

bvaughn avatar bvaughn commented on June 8, 2024

Or, add a setSize method to the Panel API so that I can set the size of this specific panel.

This already exists (resize). You can check out the other imperative methods here:
https://react-resizable-panels.vercel.app/examples/imperative-panel-api

from react-resizable-panels.

bvaughn avatar bvaughn commented on June 8, 2024

It may be worth clarifying that I intentionally decided not to support pixel sizes. If the library has bugs, I'll try to fix them, but if it's something that only happens due to trying to add pixel size constraints on top of the system, then I think that falls outside of the scope of what I can reasonably maintain as a side project (especially given that I don't need/use pixel constraints).

from react-resizable-panels.

viveleroi avatar viveleroi commented on June 8, 2024

Oh I missed there was a resize method, I was looking for a setSize given there's a getSize. Also the onCollapse signature on the docs page is out of date.

from react-resizable-panels.

bvaughn avatar bvaughn commented on June 8, 2024

Oh I missed there was a resize method, I was looking for a setSize given there's a getSize.

The API is called resize.

It sounds like maybe this is a bug that should be fixed though, regardless of pixels vs percentage, so I'll leave it open.

Also the onCollapse signature on the docs page is out of date.

I don't think this is mentioned on the docs. I see you meant the README. I thought you meant the website.

That's also unrelated to the issue we're discussing though, so let's preferably keep this focused to one thing. (It's hard to track otherwise.)

Preferably just send a PR for docs mistakes ;)

from react-resizable-panels.

bvaughn avatar bvaughn commented on June 8, 2024

I believe 0a410c8 should fix what I would consider an edge case bug with non-pixel usage (but one you'll need for pixel stuff to work). Hope it helps!

from react-resizable-panels.

bvaughn avatar bvaughn commented on June 8, 2024

Released in [email protected]


❤️ → ☕ givebrian.coffee

from react-resizable-panels.

viveleroi avatar viveleroi commented on June 8, 2024

Thanks, this seems to work. I don't have to call resize anymore. Although one issue I noticed is that when you resize the window it randomly loses the collapsed state. I thought I had a way to call collapse() again based on my duplicate state boolean but that doesn't fix it. It happens no matter how you resize so it's not like the area becomes larger than the collapseSize threshold or anything. Something is causing collapsed state to be lost in the library and it auto-expands.

from react-resizable-panels.

viveleroi avatar viveleroi commented on June 8, 2024

Should I file a new issue for the collapse state bug?

from react-resizable-panels.

bvaughn avatar bvaughn commented on June 8, 2024

If you're able to submit a bug report with a full repro, I'll take a look.

from react-resizable-panels.

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.