Skip to content

Commit e92b45a

Browse files
authored
Grid placement controls: Improve attribute logic (#61420)
1 parent 7b221c0 commit e92b45a

File tree

1 file changed

+14
-2
lines changed
  • packages/block-editor/src/components/child-layout-control

1 file changed

+14
-2
lines changed

packages/block-editor/src/components/child-layout-control/index.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,13 @@ export default function ChildLayoutControl( {
223223
} }
224224
value={ columnStart }
225225
min={ 1 }
226-
max={ parentLayout?.columnCount }
226+
max={
227+
parentLayout?.columnCount
228+
? parentLayout.columnCount -
229+
( columnSpan ?? 1 ) +
230+
1
231+
: undefined
232+
}
227233
/>
228234
</FlexItem>
229235
<FlexItem style={ { width: '50%' } }>
@@ -241,7 +247,13 @@ export default function ChildLayoutControl( {
241247
} }
242248
value={ rowStart }
243249
min={ 1 }
244-
max={ parentLayout?.columnCount }
250+
max={
251+
parentLayout?.rowCount
252+
? parentLayout.rowCount -
253+
( rowSpan ?? 1 ) +
254+
1
255+
: undefined
256+
}
245257
/>
246258
</FlexItem>
247259
</Flex>

0 commit comments

Comments
 (0)