diff --git a/packages/ali-react-table/src/pipeline/features/columnHover.tsx b/packages/ali-react-table/src/pipeline/features/columnHover.tsx index 8f08f9a72..eb2e5fa37 100644 --- a/packages/ali-react-table/src/pipeline/features/columnHover.tsx +++ b/packages/ali-react-table/src/pipeline/features/columnHover.tsx @@ -43,7 +43,7 @@ export function columnHover(opts: ColumnHoverFeatureOptions = {}) { const prevCellProps = prevGetCellProps?.(value, record, rowIndex) return mergeCellProps(prevCellProps, { - style: { '--bgcolor': colIndexMatched ? hoverColor : undefined } as any, + style: { '--bgcolor': colIndexMatched ? hoverColor : prevCellProps?.style?.['--bgcolor'] } as any, onMouseEnter() { onChangeHoverColIndex(range.start) }, diff --git a/packages/ali-react-table/src/pipeline/features/columnRangeHover.tsx b/packages/ali-react-table/src/pipeline/features/columnRangeHover.tsx index 3d32998d3..0eec9242e 100644 --- a/packages/ali-react-table/src/pipeline/features/columnRangeHover.tsx +++ b/packages/ali-react-table/src/pipeline/features/columnRangeHover.tsx @@ -57,7 +57,7 @@ export function columnRangeHover(opts: ColumnRangeHoverFeatureOptions = {}) { onMouseLeave() { onChangeHoverRange(EMPTY_RANGE) }, - style: { '--header-bgcolor': match ? headerHoverColor : undefined } as any, + style: { '--header-bgcolor': match ? headerHoverColor : col.headerCellProps?.style?.['--header-bgcolor'] } as any, }), } } @@ -73,7 +73,7 @@ export function columnRangeHover(opts: ColumnRangeHoverFeatureOptions = {}) { onMouseLeave() { onChangeHoverRange(EMPTY_RANGE) }, - style: { '--header-bgcolor': match ? headerHoverColor : undefined } as any, + style: { '--header-bgcolor': match ? headerHoverColor : col.headerCellProps?.style?.['--header-bgcolor'] } as any, }), getCellProps(value: any, record: any, rowIndex: number): CellProps { @@ -86,7 +86,7 @@ export function columnRangeHover(opts: ColumnRangeHoverFeatureOptions = {}) { onMouseLeave() { onChangeHoverRange(EMPTY_RANGE) }, - style: { '--bgcolor': match ? hoverColor : undefined } as any, + style: { '--bgcolor': match ? hoverColor : prevCellProps?.style?.['--bgcolor'] } as any, }) }, }