Skip to content

Commit

Permalink
Grid placement controls: Improve attribute logic (#61420)
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks authored May 7, 2024
1 parent 7b221c0 commit e92b45a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/block-editor/src/components/child-layout-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,13 @@ export default function ChildLayoutControl( {
} }
value={ columnStart }
min={ 1 }
max={ parentLayout?.columnCount }
max={
parentLayout?.columnCount
? parentLayout.columnCount -
( columnSpan ?? 1 ) +
1
: undefined
}
/>
</FlexItem>
<FlexItem style={ { width: '50%' } }>
Expand All @@ -241,7 +247,13 @@ export default function ChildLayoutControl( {
} }
value={ rowStart }
min={ 1 }
max={ parentLayout?.columnCount }
max={
parentLayout?.rowCount
? parentLayout.rowCount -
( rowSpan ?? 1 ) +
1
: undefined
}
/>
</FlexItem>
</Flex>
Expand Down

0 comments on commit e92b45a

Please sign in to comment.