Skip to content

Commit

Permalink
fix: prevent visual glitch when entering field edit mode
Browse files Browse the repository at this point in the history
Currently, when a field enters edit mode, its height exceeds the outermost container's height. Applying the `flex` class forces it to respect the height limit, preventing the bottom border from disappearing.
  • Loading branch information
rentalhost committed Aug 14, 2024
1 parent ded0630 commit 2207c94
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/components/gui/table-cell/create-editable-cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { DatabaseValue } from "@/drivers/base-driver";
import OptimizeTableState from "../table-optimized/OptimizeTableState";
import { useFullEditor } from "../providers/full-editor-provider";
import { OptimizeTableHeaderWithIndexProps } from "../table-optimized";
import { cn } from "@/lib/utils";

export interface TableEditableCell<T = unknown> {
value: DatabaseValue<T>;
Expand Down Expand Up @@ -136,17 +137,15 @@ export default function createEditableCell<T = unknown>({
state.exitEditMode();
}, [setEditValue, state, value]);

const className = [
"libsql-cell",
focus ? "libsql-focus" : null,
isChanged ? "libsql-change" : null,
]
.filter(Boolean)
.join(" ");

if (editMode && (editor === undefined || editor === "input")) {
return (
<div className={className}>
<div
className={cn(
"libsql-cell flex",
focus && "libsql-focus",
isChanged && "libsql-change"
)}
>
<InputCellEditor
state={state}
readOnly={state.getReadOnlyMode()}
Expand Down

0 comments on commit 2207c94

Please sign in to comment.