Giter VIP home page Giter VIP logo

Comments (4)

DanFessler avatar DanFessler commented on September 25, 2024

This is something I've been meaning to add. I haven't seen anyone else add it yet, so I'll probably give it a go today. Curious what your intended snapping behavior is that you're looking for - Arbitrary snap positions, or just snapping to the min and max size?

from react-panelgroup.

DanFessler avatar DanFessler commented on September 25, 2024

Added experimental support for it. You can supply an array of snap positions so you can have multiple per panel. (see readme) There are some edge cases which trigger a maximum call stack error that I need to work out, but it still works for the most part. Feel free to contribute to make it better.

from react-panelgroup.

mkulinski avatar mkulinski commented on September 25, 2024

Hey Dan,

Thanks for getting back to me. My intention with the snap feature is to only allow the user to resize at a fixed interval of percentages based on the overall size of the panel group. So every panel group would only allow the user to have a panel either 15%, 25%, 50%, 75%. Something like that.

I haven't had a chance to play with your new addition, but I look forward to diving into it today.

from react-panelgroup.

DanFessler avatar DanFessler commented on September 25, 2024

Gotcha. My implementation snaps to pixel positions rather than percentages. Also it only snaps when you are close to the snap target (currently that margin is a hard coded constant, should be changed) - so it's a bit less heavy handed than what you're after.

I'll think a bit about how well your implementation makes sense for this project, but you might be able to take a look at the changes I made on this latest push to get an idea for how to implement it yourself.

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.