feat(cdk/drag-drop): introduce resetToBoundary#30436
Conversation
src/cdk/drag-drop/drag-ref.ts
Outdated
| resetToBoundary(): void { | ||
| // can be null if the drag item was never dragged. | ||
| if (this._boundaryElement) { | ||
| let x = this._boundaryElement.offsetWidth - this._rootElement.offsetWidth, |
There was a problem hiding this comment.
I'm not sure I follow why we need the offset here, it seems like it just gets moved all the way to the right of the boundary. I think we should check if the element is outside the boundary and move it by the amount of overflow pixels.
There was a problem hiding this comment.
yes, I initially just moved it to the right of the boundary. I have made it calculate now offset of the overflown pixels. lemme know if this needs any more correction.
|
Looks like there's a merge conflicts in the API goldens. |
this commit introduces `resetToBoundary` in DragRef which allows user to align DragItem to its boundary on demand if at one point it was at a place where the boundary element used to be and has shrinked causing DragItem to be outside of the boundary box fixes angular#30325
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
this commit introduces
resetToBoundaryin DragRef which allows user to align DragItem to its boundary on demand if at one point it was at a place where the boundary element used to be and has shrinked causing DragItem to be outside of the boundary boxfixes #30325