Skip to content

Commit 00a6e4e

Browse files
tellthemachinesramonjdandrewserongnoisysocks
authored
Try removing top and left grid drag handles in stable (auto) mode (#73864)
Co-authored-by: tellthemachines <[email protected]> Co-authored-by: ramonjd <[email protected]> Co-authored-by: andrewserong <[email protected]> Co-authored-by: noisysocks <[email protected]>
1 parent c6d4da9 commit 00a6e4e

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

packages/block-editor/src/components/grid/grid-item-resizer.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,29 @@ function GridItemResizerInner( {
6161
const blockClientRect = blockElement.getBoundingClientRect();
6262
const rootBlockClientRect =
6363
rootBlockElement.getBoundingClientRect();
64+
65+
const topAvailable = blockClientRect.top > rootBlockClientRect.top;
66+
const bottomAvailable =
67+
blockClientRect.bottom < rootBlockClientRect.bottom;
68+
const leftAvailable =
69+
blockClientRect.left > rootBlockClientRect.left;
70+
const rightAvailable =
71+
blockClientRect.right < rootBlockClientRect.right;
72+
6473
setEnableSide( {
65-
top: blockClientRect.top > rootBlockClientRect.top,
66-
bottom: blockClientRect.bottom < rootBlockClientRect.bottom,
67-
left: blockClientRect.left > rootBlockClientRect.left,
68-
right: blockClientRect.right < rootBlockClientRect.right,
74+
top: !! isManualGrid
75+
? topAvailable
76+
: ! bottomAvailable && topAvailable,
77+
bottom: bottomAvailable,
78+
left: !! isManualGrid
79+
? leftAvailable
80+
: ! rightAvailable && leftAvailable,
81+
right: rightAvailable,
6982
} );
7083
} );
7184
observer.observe( blockElement );
7285
return () => observer.disconnect();
73-
}, [ blockElement, rootBlockElement ] );
86+
}, [ blockElement, rootBlockElement, isManualGrid ] );
7487

7588
const justification = {
7689
right: 'left',

0 commit comments

Comments
 (0)