Commit ad917d5 1 parent 7b067aa commit ad917d5 Copy full SHA for ad917d5
File tree 1 file changed +9
-15
lines changed
packages/block-editor/src/components/grid
1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -119,28 +119,22 @@ function GridItemResizerInner( {
119
119
} }
120
120
bounds = { bounds }
121
121
boundsByDirection
122
+ onPointerDown = { ( { target, pointerId } ) => {
123
+ /*
124
+ * Captures the pointer to avoid hiccups while dragging over objects
125
+ * like iframes and ensures that the event to end the drag is
126
+ * captured by the target (resize handle) whether or not it’s under
127
+ * the pointer.
128
+ */
129
+ target . setPointerCapture ( pointerId ) ;
130
+ } }
122
131
onResizeStart = { ( event , direction ) => {
123
132
/*
124
133
* The container justification and alignment need to be set
125
134
* according to the direction the resizer is being dragged in,
126
135
* so that it resizes in the right direction.
127
136
*/
128
137
setResizeDirection ( direction ) ;
129
-
130
- /*
131
- * The mouseup event on the resize handle doesn't trigger if the mouse
132
- * isn't directly above the handle, so we try to detect if it happens
133
- * outside the grid and dispatch a mouseup event on the handle.
134
- */
135
- blockElement . ownerDocument . addEventListener (
136
- 'mouseup' ,
137
- ( ) => {
138
- event . target . dispatchEvent (
139
- new Event ( 'mouseup' , { bubbles : true } )
140
- ) ;
141
- } ,
142
- { once : true }
143
- ) ;
144
138
} }
145
139
onResizeStop = { ( event , direction , boxElement ) => {
146
140
const columnGap = parseFloat (
You can’t perform that action at this time.
0 commit comments