Comments (4)
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.
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.
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.
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)
- Support for TS typings? HOT 3
- Is it possible to know when 'dragging' is in progress? HOT 1
- Sizes don't match error HOT 2
- Unable to find node on an unmounted component error HOT 2
- Panel separator thickness HOT 1
- Don't understand the stretch property HOT 1
- Console warning componentWillReceiveProps HOT 1
- Scrolling within panels HOT 7
- Panels will not fill height of page HOT 1
- Ability to customize CSS class names? HOT 4
- option to keep panel heights synchronized
- Getting : Warning: A string ref, "resizeObject", has been found within a strict mode tree HOT 1
- Expose defaults for panel widthss
- Option to avoid recursive resizing HOT 3
- How to import PanelGroup and Content in js code after npm install react-panelgroup?
- Changing direction programmatically causes resize function to stop working
- Please update to work with React > 17
- Application breaks when min width is set to > 155
- How to disable Neighbor-Aware Resizing ?
- Cannot read properties of undefined (reading 'style') when dynamically adding an additional panel
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-panelgroup.