@okta/odyssey-react-mui 1.12.4 → 1.12.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okta/odyssey-react-mui",
3
- "version": "1.12.4",
3
+ "version": "1.12.5",
4
4
  "description": "React MUI components for Odyssey, Okta's design system",
5
5
  "author": "Okta, Inc.",
6
6
  "license": "Apache-2.0",
@@ -51,7 +51,7 @@
51
51
  "@mui/system": "^5.14.9",
52
52
  "@mui/utils": "^5.11.2",
53
53
  "@mui/x-date-pickers": "^5.0.15",
54
- "@okta/odyssey-design-tokens": "1.12.4",
54
+ "@okta/odyssey-design-tokens": "1.12.5",
55
55
  "date-fns": "^2.30.0",
56
56
  "i18next": "^23.5.1",
57
57
  "material-react-table": "^2.0.2",
@@ -63,5 +63,5 @@
63
63
  "react": ">=17 <19",
64
64
  "react-dom": ">=17 <19"
65
65
  },
66
- "gitHead": "b5b53ea203c3017a6fd6dc6642a1dfc9a19df7fd"
66
+ "gitHead": "1479286658569d5d4b9842b0d8083cc3d1cb06bd"
67
67
  }
package/src/Select.tsx CHANGED
@@ -212,18 +212,23 @@ const Select = <
212
212
  // data types that might be passed
213
213
  const normalizedOptions = useMemo(
214
214
  () =>
215
- options.map((option) =>
216
- typeof option === "object"
217
- ? {
218
- text: option.text,
219
- value:
220
- option?.value === ""
221
- ? option.value
222
- : option.value || option.text,
223
- type: option.type === "heading" ? "heading" : "option",
224
- }
225
- : { text: option, value: option, type: "option" }
226
- ),
215
+ options.map((option) => {
216
+ if (typeof option === "object") {
217
+ /**
218
+ * If the value of `option?.value is an empty string, we need to make sure that we
219
+ * set an empty string to `value` in the normalized option so that the select component
220
+ * can potentially set it as the selected one in the text input
221
+ */
222
+ const value =
223
+ option?.value === "" ? option.value : option.value || option.text;
224
+ return {
225
+ text: option.text,
226
+ value,
227
+ type: option.type === "heading" ? "heading" : "option",
228
+ };
229
+ }
230
+ return { text: option, value: option, type: "option" };
231
+ }),
227
232
  [options]
228
233
  );
229
234
 
package/src/TextField.tsx CHANGED
@@ -191,7 +191,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
191
191
  "aria-errormessage": errorMessageElementId,
192
192
  "aria-labelledby": labelElementId,
193
193
  "data-se": testId,
194
- inputmode: inputMode,
194
+ inputMode,
195
195
  }}
196
196
  inputRef={localInputRef}
197
197
  multiline={isMultiline}