Skip to content

docs(ui5-tree): add move and move-over event documentation #11538

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
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions packages/main/src/Tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,32 @@ type WalkCallback = (item: TreeItemBase, level: number, index: number) => void;
@event("selection-change", {
bubbles: true,
})

/**
* Fired when a movable tree item is moved over a potential drop target during a drag-and-drop operation.
*
* If the new position is valid, prevent the default action of the event using `preventDefault()`.
* @param {object} source Contains information about the moved element under the `element` property.
* @param {object} destination Contains information about the destination of the moved element. Has `element` and `placement` properties.
* @public
*/
@event("move", {
bubbles: true,
})

/**
* Fired when a movable tree item is dropped onto a drop target.
*
* **Note:** The `move` event is fired only if there was a preceding `move-over` event with prevented default action.
* @param {object} source Contains information about the moved element under the `element` property.
* @param {object} destination Contains information about the destination of the moved element. Has `element` and `placement` properties.
* @public
*/
@event("move-over", {
bubbles: true,
cancelable: true,
})

class Tree extends UI5Element {
eventDetails!: {
"item-toggle": TreeItemToggleEventDetail,
Expand Down
Loading