diff --git a/packages/toast-ui.grid/src/dispatch/rowSpan.ts b/packages/toast-ui.grid/src/dispatch/rowSpan.ts index e3f910389..58b4c941d 100644 --- a/packages/toast-ui.grid/src/dispatch/rowSpan.ts +++ b/packages/toast-ui.grid/src/dispatch/rowSpan.ts @@ -23,7 +23,10 @@ export function updateRowSpanWhenAppending(data: Row[], prevRow: Row, extendPrev const startOffset = keyRow || extendPrevRowSpan ? 1 : -count + 1; // keep rowSpan state when appends row in the middle of rowSpan - if (mainRowSpan.spanCount > startOffset) { + if ( + mainRowSpan.spanCount > startOffset || + (mainRowSpan.spanCount === 1 && startOffset === 1) + ) { mainRowSpan.count += 1; mainRowSpan.spanCount += 1; diff --git a/packages/toast-ui.grid/src/store/data.ts b/packages/toast-ui.grid/src/store/data.ts index c8d5b85ef..bccff5bad 100644 --- a/packages/toast-ui.grid/src/store/data.ts +++ b/packages/toast-ui.grid/src/store/data.ts @@ -354,7 +354,8 @@ function createSubRowSpan(prevRowSpanMap: RowSpanMap) { Object.keys(prevRowSpanMap).forEach((columnName) => { const prevRowSpan = prevRowSpanMap[columnName]; const { mainRowKey, count, spanCount } = prevRowSpan; - if (spanCount > 1 - count) { + + if (spanCount > 1 && spanCount > 1 - count) { const subRowCount = count >= 0 ? -1 : count - 1; subRowSpanMap[columnName] = createRowSpan(false, mainRowKey, subRowCount, spanCount); }