* Attempts to move an item into the container. * @param item Item that was moved into the container. * @param pointerX Position of the item along the X axis. * @param pointerY Position of the item along the Y axis. * @param index Index at which the item entered. If omitted, the container
(item: DragRef, pointerX: number, pointerY: number, index?: number)
| 263 | * out automatically. |
| 264 | */ |
| 265 | enter(item: DragRef, pointerX: number, pointerY: number, index?: number): void { |
| 266 | this._draggingStarted(); |
| 267 | |
| 268 | // If sorting is disabled, we want the item to return to its starting |
| 269 | // position if the user is returning it to its initial container. |
| 270 | if (index == null && this.sortingDisabled) { |
| 271 | index = this._draggables.indexOf(item); |
| 272 | } |
| 273 | |
| 274 | this._sortStrategy.enter(item, pointerX, pointerY, index); |
| 275 | |
| 276 | // Note that this usually happens inside `_draggingStarted` as well, but the dimensions |
| 277 | // can change when the sort strategy moves the item around inside `enter`. |
| 278 | this._cacheParentPositions(); |
| 279 | |
| 280 | // Notify siblings at the end so that the item has been inserted into the `activeDraggables`. |
| 281 | this._notifyReceivingSiblings(); |
| 282 | this.entered.next({item, container: this, currentIndex: this.getItemIndex(item)}); |
| 283 | } |
| 284 | |
| 285 | /** |
| 286 | * Removes an item from the container after it was dragged into another container by the user. |
nothing calls this directly
no test coverage detected