Skip to content

Commit

Permalink
fix: insert multiple rows losing anchorId (#1189)
Browse files Browse the repository at this point in the history
  • Loading branch information
caoxing9 authored Dec 23, 2024
1 parent f136e94 commit 38491d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,10 @@ export const GridViewBaseInner: React.FC<IGridViewBaseInnerProps> = (
if (num === 0) {
return;
}
setPrefillingRowOrder(rowOrder);
if (num === 1 || num === undefined) {
setPrefillingFieldValueMap(fieldValueMap);
setPrefillingRowOrder(rowOrder);

setPrefillingRowIndex(index);
setSelection(emptySelection);
gridRef.current?.setSelection(emptySelection);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const InsertRecordRender = (props: InsertRecordRender) => {
<Button
variant={'ghost'}
size="sm"
className="m-0 flex size-full h-5 justify-start gap-0 p-0"
className="mt-px size-full h-9 justify-start gap-0 px-4 py-2"
onClick={() => {
onClick(num);
}}
Expand Down Expand Up @@ -236,7 +236,12 @@ export const RecordMenu = () => {
{items.map(({ type, name, icon, className, disabled, onClick, render }) => {
return (
<CommandItem
className={cn('px-4 py-2', className)}
className={cn('px-4 py-2', className, {
'px-0 py-0': [
MenuItemType.InsertBelow,
MenuItemType.InsertAbove,
].includes(type),
})}
key={type}
value={name}
onSelect={async () => {
Expand Down

0 comments on commit 38491d0

Please sign in to comment.