Comments (10)
If it is passed as 60, that means the top and bottom 20% of the item would not be considered as 'sortZone`.
@oyeanuj I think passing 60 would mean that top and bottom 30% would be the only place for sorting the list i.e. top and bottom 30% should be considered as sortZone and middle 40% would be considered for drop over existing element.
from react-reorder.
@oyeanuj you'd set the data attribute on an element inside one of your items, and then it'd check for that, and check for collisions against that element, rather than the root node of an item.
from react-reorder.
Ah, I didn't realise you'd need a specific droppable area. Can't use margins between them? I guess styles should remain separate from functionality, so adding some way to configure this would be good.
Although you can achieve something similar with CSS: https://jsfiddle.net/fr7syq3d/
from react-reorder.
Actually, scratch that CSS, that'd also mean you could only drag by clicking inside the droppable area... :|
from react-reorder.
I'll have a think about possible ways to do this and try to get it into v3. :)
from react-reorder.
Yes, I realized that having a droppable area makes it configurable and more reusable, given that we anyways have a default of 100%. Also, +1 to not using CSS for this as it is really functional :)
from react-reorder.
+1 👍
from react-reorder.
@champeng Yes, you are right! I meant top and bottom would be considered sortZone
and middle area would be dropZone
.
@JakeSidSmith Any other thoughts since your last comment? 😄
from react-reorder.
@oyeanuj sorry, been pretty busy with other projects / new version of react-reorder.
Something I have been using a bit in v3 is data attributes for new features. I could add something that looks for data-drop-zone
and checks this element for collisions if one is found. This way you can completely configure which area of your items should be allowed drops.
from react-reorder.
@JakeSidSmith Thanks for the response! So, if the attribute is set, then the library checks for collision? And then that would imply the need for some props to determine collision boundaries?
from react-reorder.
Related Issues (20)
- Unable to make 3.0.0-alpha.7 work with react 16.9 HOT 5
- Less performant deeper in the dom? HOT 1
- Please add events on "drag start" and "drag end" HOT 3
- Can't disable auto scroll HOT 7
- Another complete re-write in TypeScript, with hooks, React 16-17 support, and more HOT 4
- can't reorder
- TypeError: this.state.draggedStyle is null HOT 2
- Update PropTypes HOT 1
- Warning: This synthetic event is reused for performance reasons. HOT 3
- placeholder class is not added when dragging input fields HOT 3
- V3 Alpha Issues HOT 47
- Warning with react 15.5.0 HOT 12
- can't control dragged div HOT 17
- Images Reloading/Flashing HOT 9
- Error: Expected reorderId to be a string. Instead got undefined HOT 12
- Tidy up prop documentation in readme (v3) HOT 2
- Support React v16 HOT 11
- Issues with embedded images? HOT 6
- Unable to set reorder to a button HOT 3
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-reorder.