Skip to content
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

dndzone: the inputbox is draggable and will cause the dropdown break #165

Closed
stevenyh3 opened this issue Apr 19, 2023 · 3 comments
Closed
Labels
bug Something isn't working feature request
Milestone

Comments

@stevenyh3
Copy link

image
image
As you can see, the input box is draggable and will cause the multiselection break.
Also, is it possible to passing in a custom event to check when finish dragging & drop the element in the dndzone? Such as on:drop, on: on:finalize.
Tks a lot!

@stevenyh3
Copy link
Author

Also can the outline style when dragging elements being removed?
The demo here can see that when dragging the elements, the style of dragging elements will be changed.

@mskocik mskocik added the bug Something isn't working label Apr 24, 2023
@mskocik mskocik added this to the v4.0 milestone Jul 2, 2023
@firtrfl
Copy link

firtrfl commented Jan 24, 2024

image

Hi @mskocik and thanks for this amazing library. I have observed another bug. I am not exactly sure if it is the same as the one described above. But the problem is, that the "placeholder" text can be also dragged, but if that happens there is an error an you need to reload the window to be able to drag again the items.

I have fixed this locally by a small hack in src/components/Control.svelte where I set dragDisabled: true if the length of the selectedOptions is less than 1:

  // prevent dragging if there are no selected items
  // to solve the bug when trying to drag an empty selection
  $: dragDisabled = selectedOptions.length < 1;
</script>

<div
  class="sv-control"
  class:is-active={$hasFocus}
  class:is-disabled={disabled}
  on:mousedown|preventDefault
  on:click|preventDefault={focusControl}
>
  <slot name="icon" />
  <!-- selection & input -->
  <div
    class="sv-content sv-input-row"
    class:has-multiSelection={multiple}
    use:dndzone={{
      items: selectedOptions,
      flipDurationMs,
      type: inputId,
      dragDisabled: dragDisabled,
    }}
    on:consider
    on:finalize
  >

This is probably not the best way of doing it but I just thought I would share.

@mskocik
Copy link
Owner

mskocik commented Feb 16, 2024

This is issue in svelte-dnd-action. Related issue isaacHagoel/svelte-dnd-action#452.

However in current master and therefore in upcoming v4 it will be fixed.

@mskocik mskocik closed this as completed Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature request
Projects
None yet
Development

No branches or pull requests

3 participants