@page-speed/forms 0.4.9 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/inputs.js CHANGED
@@ -1043,6 +1043,7 @@ function Select2({
1043
1043
  return options;
1044
1044
  }, [options, optionGroups]);
1045
1045
  const hasValue = Boolean(value);
1046
+ const selectValue = value ? String(value) : void 0;
1046
1047
  const handleValueChange = (newValue) => {
1047
1048
  onChange(newValue);
1048
1049
  };
@@ -1056,15 +1057,35 @@ function Select2({
1056
1057
  onBlur?.();
1057
1058
  }
1058
1059
  };
1059
- return /* @__PURE__ */ React17.createElement(
1060
- Select,
1060
+ return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
1061
+ "input",
1061
1062
  {
1063
+ type: "hidden",
1062
1064
  name,
1063
- value,
1065
+ value: value ?? "",
1066
+ disabled,
1067
+ required,
1068
+ tabIndex: -1,
1069
+ "aria-hidden": "true",
1070
+ style: {
1071
+ position: "absolute",
1072
+ width: "1px",
1073
+ height: "1px",
1074
+ padding: "0",
1075
+ margin: "-1px",
1076
+ overflow: "hidden",
1077
+ clip: "rect(0, 0, 0, 0)",
1078
+ whiteSpace: "nowrap",
1079
+ border: "0"
1080
+ }
1081
+ }
1082
+ ), /* @__PURE__ */ React17.createElement(
1083
+ Select,
1084
+ {
1085
+ value: selectValue,
1064
1086
  onValueChange: handleValueChange,
1065
1087
  onOpenChange: handleOpenChange,
1066
- disabled,
1067
- required
1088
+ disabled
1068
1089
  },
1069
1090
  /* @__PURE__ */ React17.createElement(
1070
1091
  SelectTrigger,
@@ -1104,7 +1125,7 @@ function Select2({
1104
1125
  renderOption ? renderOption(option) : option.label
1105
1126
  ))
1106
1127
  ))
1107
- );
1128
+ ));
1108
1129
  }
1109
1130
  Select2.displayName = "Select";
1110
1131
  function MultiSelect({