-
Notifications
You must be signed in to change notification settings - Fork 24
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
Why not to use slots? #2
Comments
I didn't use slots primarily because I didn't anticipate that doing so would be useful. The original design scope of this component was simply to provide the end user a way to order a list of strings. Additionally, this component relies on carefully controlled pointer events. Providing more opportunities for list items to be interactive also provides more opportunities for problems with the drag and drop behavior. Anyways, please tell me more about why/how you would like to use slots - I want to make this component as useful as possible. |
This is what I use: I am passing down another component, with the input, three checkboxes, and a few labels. My component fires several events to be served by a component up in the hierarchy. |
+1 for slots. I want to use this to make a sortable file tree, where nodes can be folders that contain other nodes. So I need full control over the "list elements" (and would scrap the up/down and delete buttons). Ergo I need slots. |
@nicknack23 This fork appears to have made some of the enhancements we're looking for: https://github.com/Lindsay-Needs-Sleep/svelte-dragdroplist |
I found using svelte-sortable easier after all. You can simply pass a component to your list item, this is demonstrated here REPL. |
@jwlarocque +1 for slots. I would use it like the html attribute in the objects. For me it's cleaner this way to format the objects. F.e. I want use flexbox to show title of music on the left side and the duration on the right side. |
Why not to use slots for rendering list items?
The text was updated successfully, but these errors were encountered: