fix(async-select): fix select loading bugs

This commit is contained in:
2026-06-18 01:24:52 +05:30
parent 463ee0835f
commit d7c4027328
12 changed files with 696 additions and 18 deletions

View File

@@ -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 ? (