Skip to content

[Tree, TreeItemCustom]: Drag and Drop does not work in some cases #11225

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

Open
1 task done
vonBrax opened this issue Mar 31, 2025 · 1 comment
Open
1 task done

[Tree, TreeItemCustom]: Drag and Drop does not work in some cases #11225

vonBrax opened this issue Mar 31, 2025 · 1 comment
Labels
bug This issue is a bug in the code Medium Prio TOPIC P

Comments

@vonBrax
Copy link

vonBrax commented Mar 31, 2025

Bug Description

When using the Tree element with TreeItemCustom elements, in some situations the drag and drop functionality doesn't work:

  1. TreeItemCustom content takes up the full width of the tree item:

Tested both in Chrome and Firefox and the bug only happens in Chrome, but I'm not sure which browser is actually following the specs here.

The problem seems to be that in Chrome, the content element is interpreted as being a sibling from shadow root of the TreeItemCustom element, instead of being a child of the

  • element, and therefore "blocking" interactions with the
  • element.

    The drag and drop can still work if you drag tree item on its very start or end, but anywhere in the middle of it won't work.

    1. Tree element is used inside another CustomElement:

    In this case, the problem seems to be related to how the dragged source element is found:

    Using event.target here will return the outer CustomElement element and not the actual dragged element in its shadow dom.

    Affected Component

    Tree, TreeItemCustom

    Expected Behaviour

    Drag and drop should work also for Trees with TreeItemCustom

    Isolated Example

    https://stackblitz.com/edit/vitejs-vite-pnft8v5r?file=src%2Fmain.ts

    Steps to Reproduce

    1. Either create a Tree with TreeItemCustom, while giving them full-width or
    2. Use the Tree inside another Webcomponent
    3. Try to drag and drop

    (Both cases are present in the linked repro)

    Log Output, Stack Trace or Screenshots

    No response

    Priority

    Medium

    UI5 Web Components Version

    2.8.0

    Browser

    Chrome, Firefox

    Operating System

    Windows

    Additional Context

    No response

    Organization

    No response

    Declaration

    • I’m not disclosing any internal or sensitive information.
  • @vonBrax vonBrax added the bug This issue is a bug in the code label Mar 31, 2025
    @hinzzx hinzzx self-assigned this Apr 1, 2025
    @hinzzx
    Copy link
    Contributor

    hinzzx commented Apr 1, 2025

    Hi colleagues @SAP/ui5-webcomponents-topic-p ,

    There is a problem with the Drag and Drop functionality when a ui5-tree is used with ui5-tree-item-custom elements.

    In the provided sample the reporter presented the problem very well and with proposed solutions.

    Could you please, take a look ?

    Best Regards,
    Stoyan

    @hinzzx hinzzx removed their assignment Apr 1, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    bug This issue is a bug in the code Medium Prio TOPIC P
    Projects
    Development

    No branches or pull requests

    2 participants