Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: do not auto-complete (#20728)

ecmadaoa1248cf2ac89
diff --git a/frontend/src/react/components/SchemaEditorLite/Modals/EditColumnForeignKeySheet.tsx b/frontend/src/react/components/SchemaEditorLite/Modals/EditColumnForeignKeySheet.tsx
index c12d7c252f..7dceb88b91 100644
--- a/frontend/src/react/components/SchemaEditorLite/Modals/EditColumnForeignKeySheet.tsx
+++ b/frontend/src/react/components/SchemaEditorLite/Modals/EditColumnForeignKeySheet.tsx
@@ -201,7 +201,11 @@ export function EditColumnForeignKeySheet({
<label className="mb-1 block text-sm font-medium">
{t("schema-editor.foreign-key.name")}
</label>
- <Input value={fkName} onChange={(e) => setFkName(e.target.value)} />
+ <Input
+ value={fkName}
+ autoComplete="off"
+ onChange={(e) => setFkName(e.target.value)}
+ />
</div>
{showSchemaSelector && (
<div>
diff --git a/frontend/src/react/components/SchemaEditorLite/Modals/FunctionNameDialog.tsx b/frontend/src/react/components/SchemaEditorLite/Modals/FunctionNameDialog.tsx
index c17198f569..4dff73087d 100644
--- a/frontend/src/react/components/SchemaEditorLite/Modals/FunctionNameDialog.tsx
+++ b/frontend/src/react/components/SchemaEditorLite/Modals/FunctionNameDialog.tsx
@@ -89,6 +89,7 @@ export function FunctionNameDialog({
<Input
value={name}
placeholder="Function name"
+ autoComplete="off"
autoFocus
onChange={(e) => setName(e.target.value)}
onKeyDown={(e) => {
diff --git a/frontend/src/react/components/SchemaEditorLite/Modals/ProcedureNameDialog.tsx b/frontend/src/react/components/SchemaEditorLite/Modals/ProcedureNameDialog.tsx
index e790bad0a6..197374d306 100644
--- a/frontend/src/react/components/SchemaEditorLite/Modals/ProcedureNameDialog.tsx
+++ b/frontend/src/react/components/SchemaEditorLite/Modals/ProcedureNameDialog.tsx
@@ -89,6 +89,7 @@ export function ProcedureNameDialog({
<Input
value={name}
placeholder="Procedure name"
+ autoComplete="off"
autoFocus
onChange={(e) => setName(e.target.value)}
onKeyDown={(e) => {
diff --git a/frontend/src/react/components/SchemaEditorLite/Modals/SchemaNameDialog.tsx b/frontend/src/react/components/SchemaEditorLite/Modals/SchemaNameDialog.tsx
index 6b88cd00c2..dd50e334fb 100644
--- a/frontend/src/react/components/SchemaEditorLite/Modals/SchemaNameDialog.tsx
+++ b/frontend/src/react/components/SchemaEditorLite/Modals/SchemaNameDialog.tsx
@@ -79,6 +79,7 @@ export function SchemaNameDialog({
<Input
value={schemaName}
placeholder={t("schema-editor.schema.name-placeholder")}
+ autoComplete="off"
autoFocus
onChange={(e) => setSchemaName(e.target.value)}
onKeyDown={(e) => {
diff --git a/frontend/src/react/components/SchemaEditorLite/Modals/TableNamePopover.tsx b/frontend/src/react/components/SchemaEditorLite/Modals/TableNamePopover.tsx
index 374c345e3e..96059082cd 100644
--- a/frontend/src/react/components/SchemaEditorLite/Modals/TableNamePopover.tsx
+++ b/frontend/src/react/components/SchemaEditorLite/Modals/TableNamePopover.tsx
@@ -162,6 +162,7 @@ export function TableNamePopover({
<Input
value={tableName}
placeholder={t("schema-editor.table.name-placeholder")}
+ autoComplete="off"
autoFocus
onChange={(e) => setTableName(e.target.value)}
onKeyDown={(e) => {
diff --git a/frontend/src/react/components/SchemaEditorLite/Modals/ViewNameDialog.tsx b/frontend/src/react/components/SchemaEditorLite/Modals/ViewNameDialog.tsx
index 6a3dc62da5..b8fd639b53 100644
--- a/frontend/src/react/components/SchemaEditorLite/Modals/ViewNameDialog.tsx
+++ b/frontend/src/react/components/SchemaEditorLite/Modals/ViewNameDialog.tsx
@@ -89,6 +89,7 @@ export function ViewNameDialog({
<Input
value={name}
placeholder="View name"
+ autoComplete="off"
autoFocus
onChange={(e) => setName(e.target.value)}
onKeyDown={(e) => {
diff --git a/frontend/src/react/components/SchemaEditorLite/Panels/IndexesEditor/IndexesEditor.tsx b/frontend/src/react/components/SchemaEditorLite/Panels/IndexesEditor/IndexesEditor.tsx
index d47b08e993..b73e96e909 100644
--- a/frontend/src/react/components/SchemaEditorLite/Panels/IndexesEditor/IndexesEditor.tsx
+++ b/frontend/src/react/components/SchemaEditorLite/Panels/IndexesEditor/IndexesEditor.tsx
@@ -91,6 +91,7 @@ export function IndexesEditor({
<TableCell>
<Input
value={index.name}
+ autoComplete="off"
disabled={isReadonly || index.primary}
size="sm"
className="border-none bg-transparent shadow-none focus-visible:ring-1"
@@ -116,6 +117,7 @@ export function IndexesEditor({
<TableCell>
<Input
value={index.comment}
+ autoComplete="off"
disabled={isReadonly}
size="sm"
className="border-none bg-transparent shadow-none focus-visible:ring-1"
diff --git a/frontend/src/react/components/SchemaEditorLite/Panels/PartitionsEditor/PartitionsEditor.tsx b/frontend/src/react/components/SchemaEditorLite/Panels/PartitionsEditor/PartitionsEditor.tsx
index c034dfd54c..191be7353e 100644
--- a/frontend/src/react/components/SchemaEditorLite/Panels/PartitionsEditor/PartitionsEditor.tsx
+++ b/frontend/src/react/components/SchemaEditorLite/Panels/PartitionsEditor/PartitionsEditor.tsx
@@ -123,6 +123,7 @@ export function PartitionsEditor({
<TableCell>
<Input
value={partition.name}
+ autoComplete="off"
disabled={isReadonly || status === "dropped"}
size="sm"
className="border-none bg-transparent shadow-none focus-visible:ring-1"
@@ -138,6 +139,7 @@ export function PartitionsEditor({
<TableCell>
<Input
value={partition.expression}
+ autoComplete="off"
disabled={isReadonly || !isFirst || status === "dropped"}
size="sm"
className="border-none bg-transparent shadow-none focus-visible:ring-1"
@@ -150,6 +152,7 @@ export function PartitionsEditor({
<TableCell>
<Input
value={partition.value}
+ autoComplete="off"
disabled={isReadonly || status === "dropped"}
size="sm"
className="border-none bg-transparent shadow-none focus-visible:ring-1"
diff --git a/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/DataTypeCell.tsx b/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/DataTypeCell.tsx
index 08e9c0a895..b2856d3d26 100644
--- a/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/DataTypeCell.tsx
+++ b/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/DataTypeCell.tsx
@@ -148,6 +148,7 @@ export function DataTypeCell({
<Input
ref={inputRef}
value={value}
+ autoComplete="off"
disabled={readonly}
placeholder="column type"
size="xs"
diff --git a/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/DefaultValueCell.tsx b/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/DefaultValueCell.tsx
index b41fcf8b32..0e1cdf8ba8 100644
--- a/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/DefaultValueCell.tsx
+++ b/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/DefaultValueCell.tsx
@@ -31,6 +31,7 @@ export function DefaultValueCell({ column, disabled, onUpdate }: Props) {
return (
<Input
value={column.default ?? ""}
+ autoComplete="off"
disabled={disabled}
placeholder={t("schema-editor.default.placeholder")}
size="xs"
diff --git a/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/TableColumnEditor.tsx b/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/TableColumnEditor.tsx
index a7ba10db76..b33872f46d 100644
--- a/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/TableColumnEditor.tsx
+++ b/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/TableColumnEditor.tsx
@@ -359,6 +359,7 @@ export function TableColumnEditor({
autoFocus={status === "created" && column.name === ""}
placeholder={t("schema-editor.column.name-placeholder")}
value={column.name}
+ autoComplete="off"
disabled={disabled}
size="xs"
className={INLINE_EDIT_INPUT_CLASS}
@@ -385,6 +386,7 @@ export function TableColumnEditor({
<TableCell className={cellClass}>
<Input
value={column.comment}
+ autoComplete="off"
disabled={disabled}
size="xs"
className={INLINE_EDIT_INPUT_CLASS}
diff --git a/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/inline-input.test.tsx b/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/inline-input.test.tsx
new file mode 100644
index 0000000000..ec04dafd6c
--- /dev/null
+++ b/frontend/src/react/components/SchemaEditorLite/Panels/TableColumnEditor/inline-input.test.tsx
@@ -0,0 +1,70 @@
+import { create } from "@bufbuild/protobuf";
+import { render, screen } from "@testing-library/react";
+import { describe, expect, test, vi } from "vitest";
+import { Engine } from "@/types/proto-es/v1/common_pb";
+import { ColumnMetadataSchema } from "@/types/proto-es/v1/database_service_pb";
+import { DataTypeCell } from "./DataTypeCell";
+import { DefaultValueCell } from "./DefaultValueCell";
+
+vi.mock("react-i18next", () => ({
+ initReactI18next: {
+ type: "3rdParty",
+ init: vi.fn(),
+ },
+ useTranslation: () => ({ t: (key: string) => key }),
+}));
+
+vi.mock("@/utils", async (importOriginal) => {
+ const actual = await importOriginal<typeof import("@/utils")>();
+ return {
+ ...actual,
+ getDataTypeSuggestionList: () => ["int", "varchar"],
+ };
+});
+
+const column = (
+ overrides: {
+ name?: string;
+ type?: string;
+ hasDefault?: boolean;
+ default?: string;
+ } = {}
+) =>
+ create(ColumnMetadataSchema, {
+ name: "id",
+ type: "int",
+ ...overrides,
+ });
+
+describe("SchemaEditorLite inline inputs", () => {
+ test("disables browser suggestions for the column type input", () => {
+ render(
+ <DataTypeCell
+ column={column()}
+ engine={Engine.POSTGRES}
+ readonly={false}
+ onUpdateValue={vi.fn()}
+ />
+ );
+
+ expect(screen.getByDisplayValue("int")).toHaveAttribute(
+ "autocomplete",
+ "off"
+ );
+ });
+
+ test("disables browser suggestions for the default value input", () => {
+ render(
+ <DefaultValueCell
+ column={column({ hasDefault: true, default: "0" })}
+ disabled={false}
+ onUpdate={vi.fn()}
+ />
+ );
+
+ expect(screen.getByDisplayValue("0")).toHaveAttribute(
+ "autocomplete",
+ "off"
+ );
+ });
+});
diff --git a/frontend/src/react/components/SchemaEditorLite/Panels/TableList/TableList.tsx b/frontend/src/react/components/SchemaEditorLite/Panels/TableList/TableList.tsx
index 73e2abdbd4..f25815c22d 100644
--- a/frontend/src/react/components/SchemaEditorLite/Panels/TableList/TableList.tsx
+++ b/frontend/src/react/components/SchemaEditorLite/Panels/TableList/TableList.tsx
@@ -217,6 +217,7 @@ export function TableList({
) : (
<Input
value={table.comment}
+ autoComplete="off"
disabled={status === "dropped"}
size="xs"
className={INLINE_EDIT_INPUT_CLASS}
diff --git a/frontend/src/react/components/ui/search-input.tsx b/frontend/src/react/components/ui/search-input.tsx
index 0e8d24d5d5..4633023942 100644
--- a/frontend/src/react/components/ui/search-input.tsx
+++ b/frontend/src/react/components/ui/search-input.tsx
@@ -21,6 +21,7 @@ export const SearchInput = forwardRef<HTMLInputElement, SearchInputProps>(
<Search className="absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-control-placeholder pointer-events-none" />
<Input
ref={ref}
+ autoComplete="off"
className={cn("pl-8", className)}
placeholder={placeholder ?? t("common.type-to-search")}
{...props}