fix(async-select): fix select loading bugs
This commit is contained in:
@@ -27,9 +27,14 @@ import { ColumnViewOptions } from './ColumnViewOptions';
|
||||
import { getPinnedColumnStyles } from './columnStyles';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
function shouldTruncateCell(column: { id: string; columnDef: { meta?: unknown } }) {
|
||||
function shouldTruncateCell(column: {
|
||||
id: string;
|
||||
columnDef: { meta?: unknown };
|
||||
}) {
|
||||
if (column.id === 'actions') return false;
|
||||
const meta = column.columnDef.meta as { disableTruncate?: boolean } | undefined;
|
||||
const meta = column.columnDef.meta as
|
||||
| { disableTruncate?: boolean }
|
||||
| undefined;
|
||||
return !meta?.disableTruncate;
|
||||
}
|
||||
|
||||
@@ -181,9 +186,7 @@ function DataTableContent<TData, TValue>({
|
||||
|
||||
const columnPinning = React.useMemo<ColumnPinningState>(
|
||||
() =>
|
||||
actionsSticky && actions?.length
|
||||
? { [actionsAlign]: ['actions'] }
|
||||
: {},
|
||||
actionsSticky && actions?.length ? { [actionsAlign]: ['actions'] } : {},
|
||||
[actions, actionsAlign, actionsSticky],
|
||||
);
|
||||
|
||||
@@ -281,6 +284,7 @@ function DataTableContent<TData, TValue>({
|
||||
>
|
||||
{row.getVisibleCells().map((cell) => {
|
||||
const truncate = shouldTruncateCell(cell.column);
|
||||
const pinned = cell.column.getIsPinned();
|
||||
const content = flexRender(
|
||||
cell.column.columnDef.cell,
|
||||
cell.getContext(),
|
||||
@@ -291,8 +295,8 @@ function DataTableContent<TData, TValue>({
|
||||
key={cell.id}
|
||||
style={getPinnedColumnStyles(cell.column)}
|
||||
className={cn(
|
||||
'max-w-0 overflow-hidden',
|
||||
cell.column.getIsPinned() && 'bg-card',
|
||||
'max-w-0 overflow-hidden border-b border-border',
|
||||
pinned && 'bg-card',
|
||||
)}
|
||||
>
|
||||
{truncate ? (
|
||||
|
||||
Reference in New Issue
Block a user