diff --git a/.changeset/combobox-trigger-never-submits-forms.md b/.changeset/combobox-trigger-never-submits-forms.md new file mode 100644 index 000000000..ec2717486 --- /dev/null +++ b/.changeset/combobox-trigger-never-submits-forms.md @@ -0,0 +1,12 @@ +--- +"@object-ui/components": patch +--- + +The Combobox trigger now declares `type="button"` explicitly, so it can never +submit an enclosing `
` (objectui#3344). The current Radix +`PopoverTrigger` happens to supply `type="button"` through its Slot, but that +form-safety guarantee was an upstream implementation detail — it is now a +locally declared, regression-tested contract, matching the explicit style of +LookupField / MultiSelectField / RatingField. The default sits before the +trigger pass-through spread (objectui#3318), so a consumer who explicitly +passes `type` (e.g. `type="submit"`) still wins. diff --git a/packages/components/src/__tests__/combobox-trigger-type.test.tsx b/packages/components/src/__tests__/combobox-trigger-type.test.tsx new file mode 100644 index 000000000..e2379d5e6 --- /dev/null +++ b/packages/components/src/__tests__/combobox-trigger-type.test.tsx @@ -0,0 +1,68 @@ +/** + * ObjectUI + * Copyright (c) 2024-present ObjectStack Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * objectui#3344 — the combobox trigger must not submit an enclosing form. + * + * An HTML