Skip to content

Commit

Permalink
fix: fixed the inputMode attr name and added comment to a prior change (
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispulsinelli-okta committed Feb 1, 2024
1 parent b5b53ea commit 2641612
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
Binary file not shown.
29 changes: 17 additions & 12 deletions packages/odyssey-react-mui/src/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,23 @@ const Select = <
// data types that might be passed
const normalizedOptions = useMemo(
() =>
options.map((option) =>
typeof option === "object"
? {
text: option.text,
value:
option?.value === ""
? option.value
: option.value || option.text,
type: option.type === "heading" ? "heading" : "option",
}
: { text: option, value: option, type: "option" }
),
options.map((option) => {
if (typeof option === "object") {
/**
* If the value of `option?.value is an empty string, we need to make sure that we
* set an empty string to `value` in the normalized option so that the select component
* can potentially set it as the selected one in the text input
*/
const value =
option?.value === "" ? option.value : option.value || option.text;
return {
text: option.text,
value,
type: option.type === "heading" ? "heading" : "option",
};
}
return { text: option, value: option, type: "option" };
}),
[options]
);

Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-react-mui/src/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
"aria-errormessage": errorMessageElementId,
"aria-labelledby": labelElementId,
"data-se": testId,
inputmode: inputMode,
inputMode,
}}
inputRef={localInputRef}
multiline={isMultiline}
Expand Down

0 comments on commit 2641612

Please sign in to comment.