Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix: close on tab

edsammyd5b0450d5525
diff --git a/apps/erp/app/components/Form/AddressAutocomplete.tsx b/apps/erp/app/components/Form/AddressAutocomplete.tsx
index 30f14b3f2f..61bad863bb 100644
--- a/apps/erp/app/components/Form/AddressAutocomplete.tsx
+++ b/apps/erp/app/components/Form/AddressAutocomplete.tsx
@@ -180,6 +180,15 @@ const AddressAutocomplete = ({
[setValue]
);
+ const handleKeyDown = useCallback(
+ (e: React.KeyboardEvent<HTMLInputElement>) => {
+ if (e.key === "Tab") {
+ setOpen(false);
+ }
+ },
+ []
+ );
+
const fields: AddressFields = {
autocomplete: (
<div className="relative w-full" ref={containerRef}>
@@ -189,6 +198,7 @@ const AddressAutocomplete = ({
value={value || ""}
onChange={handleChange}
onFocus={handleInputFocus}
+ onKeyDown={handleKeyDown}
autoComplete="off"
/>
{open && suggestions.length > 0 && (