Skip to content

Commit eaa6718

Browse files
authored
docs(ui5-tree): add move and move-over event documentation (#11538)
Added missing JSDoc comments for the `move` and `move-over` events to the `ui5-tree` component, describing their purpose and parameters for drag-and-drop and keyboard reordering functionality. Fixes: #11199
1 parent ee469c1 commit eaa6718

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

packages/main/src/Tree.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,32 @@ type WalkCallback = (item: TreeItemBase, level: number, index: number) => void;
183183
@event("selection-change", {
184184
bubbles: true,
185185
})
186+
187+
/**
188+
* Fired when a movable tree item is moved over a potential drop target during a drag-and-drop operation.
189+
*
190+
* If the new position is valid, prevent the default action of the event using `preventDefault()`.
191+
* @param {object} source Contains information about the moved element under the `element` property.
192+
* @param {object} destination Contains information about the destination of the moved element. Has `element` and `placement` properties.
193+
* @public
194+
*/
186195
@event("move", {
187196
bubbles: true,
188197
})
198+
199+
/**
200+
* Fired when a movable tree item is dropped onto a drop target.
201+
*
202+
* **Note:** The `move` event is fired only if there was a preceding `move-over` event with prevented default action.
203+
* @param {object} source Contains information about the moved element under the `element` property.
204+
* @param {object} destination Contains information about the destination of the moved element. Has `element` and `placement` properties.
205+
* @public
206+
*/
189207
@event("move-over", {
190208
bubbles: true,
191209
cancelable: true,
192210
})
211+
193212
class Tree extends UI5Element {
194213
eventDetails!: {
195214
"item-toggle": TreeItemToggleEventDetail,

0 commit comments

Comments
 (0)