-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow add non-draggable element in dropzone container #544
base: master
Are you sure you want to change the base?
Conversation
This seems to only allow non draggables within the container after the last child. |
Yes, only as I wrote in the description. The related issue mentions also "before" position (which I noticed after rereading now), but I was referring to the video of desired outcome. When I was playing with, I did all variants (before, inside items, after). Inside items it was possible only with some custom property defined on items themselves, but it worked, even toggling it. I just didn't want to combine it. I can add ability to allow marking items as non draggable through property. But maybe that could go into another PR? Personally I think it's better to have something than nothing |
I guess what I am struggling to understand is what is it that you can do
with this feature that you can't do without it.
Why not place the non draggable element right before the dndzone and have
both share the same parent container. With css it will look like that
element belongs in the list.
Same question applies to an element at the end or even in the middle (use 2
dndzones and place the static item in between).
I would appreciate it if you could explain.
If we do go forward with something like you suggest the implications on
aria need to be considered as well.
…On Mon, Feb 26, 2024, 16:46 Martin Skočík ***@***.***> wrote:
Yes, only as I wrote in the description. The related issue mentions also
"before" position (which I noticed after rereading now), but I was
referring to the video of desired outcome.
When I was playing with, I did all variants (before, inside items, after).
Inside items it was possible only with some custom property defined on
items themselves, but it worked, even toggling it. I just didn't want to
combine it.
Placing non-draggable before items was more problematic, because lib
doesn't expect this and dragging and droping looked bad.
I can add ability to allow marking items as non draggable through
property. But maybe that could go into another PR?
Personally I think it's better to have something than nothing
—
Reply to this email directly, view it on GitHub
<#544 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE4OZCYOFQQS75IVXNDQ4E3YVQORXAVCNFSM6AAAAABDY3KLL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRTGM3DENZWGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This REPL shows what's impossible to do correctly with wrapping div. IMHO enforcing some type of markup shouldn't be required, when simple solution exists. And it exists, we just need to take into account that Aria shouldn't be concern at all, because "init" loop skips those non-draggable items (I am speaking in general, although this PR is only about after non-draggables, which handles) so they are not participating in dnd logic in any way. This PR could be extended to handle all cases (at least I can try to implement before, which was glitchy):
|
Nice example! |
I thought the same solution, but I catch bug: when I set REPL: https://svelte.dev/repl/77eb045ce8044b5aac30df935492cdfa (I try to add a button under list into the scrollable container) firefox_jVm1NhYVNJ.mp4 |
thanks @mroforolhc ! |
FYI @mroforolhc fix here: #610 |
Change how dndzone children are being iterated to allow non-draggable element into drozone container AFTER item array. Fix #452.
This will be possible afterwards:
As of this comment:
Originally posted by @isaacHagoel in #452 (comment)
All tests passed and also all example REPLs I tried continue to works.
There is similar PR (based on name) #335 for this topic, but I would say, my PR is easier to reason about 😊