@@ -30,8 +30,8 @@ export class UmbBlockGridEntryContext
30
30
implements UmbBlockGridScalableContext
31
31
{
32
32
//
33
- readonly columnSpan = this . _layout . asObservablePart ( ( x ) => x ? .columnSpan ) ;
34
- readonly rowSpan = this . _layout . asObservablePart ( ( x ) => x ? .rowSpan ) ;
33
+ readonly columnSpan = this . _layout . asObservablePart ( ( x ) => x ? x . columnSpan ?? null : undefined ) ;
34
+ readonly rowSpan = this . _layout . asObservablePart ( ( x ) => x ? x . rowSpan ?? null : undefined ) ;
35
35
readonly layoutAreas = this . _layout . asObservablePart ( ( x ) => x ?. areas ) ;
36
36
readonly columnSpanOptions = this . _blockType . asObservablePart ( ( x ) => x ?. columnSpanOptions ?? [ ] ) ;
37
37
readonly areaTypeGridColumns = this . _blockType . asObservablePart ( ( x ) => x ?. areaGridColumns ) ;
@@ -208,7 +208,7 @@ export class UmbBlockGridEntryContext
208
208
this . observe (
209
209
observeMultiple ( [ this . columnSpan , this . relevantColumnSpanOptions , this . _entries . layoutColumns ] ) ,
210
210
( [ columnSpan , relevantColumnSpanOptions , layoutColumns ] ) => {
211
- if ( ! layoutColumns ) return ;
211
+ if ( ! layoutColumns || columnSpan === undefined ) return ;
212
212
const newColumnSpan = this . #calcColumnSpan(
213
213
columnSpan ?? layoutColumns ,
214
214
relevantColumnSpanOptions ,
@@ -230,16 +230,15 @@ export class UmbBlockGridEntryContext
230
230
this . observe (
231
231
observeMultiple ( [ this . minMaxRowSpan , this . rowSpan ] ) ,
232
232
( [ minMax , rowSpan ] ) => {
233
- if ( minMax ) {
234
- const newRowSpan = Math . max ( minMax [ 0 ] , Math . min ( rowSpan ?? 1 , minMax [ 1 ] ) ) ;
235
- if ( newRowSpan !== rowSpan ) {
236
- const layoutValue = this . _layout . getValue ( ) ;
237
- if ( ! layoutValue ) return ;
238
- this . _layout . setValue ( {
239
- ...layoutValue ,
240
- rowSpan : newRowSpan ,
241
- } ) ;
242
- }
233
+ if ( ! minMax || rowSpan === undefined ) return ;
234
+ const newRowSpan = Math . max ( minMax [ 0 ] , Math . min ( rowSpan ?? 1 , minMax [ 1 ] ) ) ;
235
+ if ( newRowSpan !== rowSpan ) {
236
+ const layoutValue = this . _layout . getValue ( ) ;
237
+ if ( ! layoutValue ) return ;
238
+ this . _layout . setValue ( {
239
+ ...layoutValue ,
240
+ rowSpan : newRowSpan ,
241
+ } ) ;
243
242
}
244
243
} ,
245
244
'observeRowSpanValidation' ,
@@ -259,10 +258,8 @@ export class UmbBlockGridEntryContext
259
258
return newColumnSpan ;
260
259
}
261
260
} else {
262
- // Reset to the layoutColumns.
263
- if ( layoutColumns !== columnSpan ) {
264
- return layoutColumns ;
265
- }
261
+ // Fallback to the layoutColumns.
262
+ return layoutColumns ;
266
263
}
267
264
return columnSpan ;
268
265
}
0 commit comments