-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add basic drag & drop functionality to color instances #2
base: main
Are you sure you want to change the base?
Conversation
Hey @rocbear, thank you very much for your contribution. I really like the drag and drop functionality. on:click|self={() => (isColorPickerVisible = !isColorPickerVisible)} Maybe this could also be fixed by only allowing the user to drag the colors with a handle, like an additional icon next to the x-icon, instead of the whole element. But this might make the implementation a bit more complex. If you fix this issue (in the way that you prefer) I will happily merge this. |
@pabueco ah right, thanks! I'll look into it and update the PR tomorrow. |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pabueco/hue-tools/AFdxgyufV92o2TbcFuzseMmT5duM |
@pabueco I think the problem came from Svelte not being able to tell how to keep track of the items by Maybe a 'reverse order' or 'shift forward/back' button would be a better option? |
So, first of all it's nice that it works now! I also don't have that much experience with svelte, but your approach seems sensible and works well. I agree that it does not feel perfect, but it's a lot better than having no way to reorder the colors. And as long as a feature like this does not negatively impact the experience of the app in general I'm happy to have a working solution that has room for improvement in the future. While I generally prefer buttons (up, down, reverse, etc.) to reorder elements because they are usually easier to implement and more consistent across devices, I don't really want to add more icons to the color cards. An option would be to add a dropdown to each color and move the delete and reorder functionalities in there. But that also doesn't sound that great to me. So I think as long as everything is working correctly your current solution is just fine. Thanks for your work! |
Hey @pabueco, thanks for the great tool! I was playing around with it and felt a drag and drop interaction for the color mixer would be handy. If it's something you're interested in including please check out this PR. It includes a simple version that relies on the HTML API (see gif below).