Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
scurker committed Oct 11, 2023
1 parent 87c2f0a commit 3fae2a9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/react/src/components/Combobox/Combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const Combobox = forwardRef<HTMLInputElement, ComboboxProps>(
const isAutoComplete = autocomplete !== 'none';
const hasError = !!error;

const selectedOpaqueValue = useMemo(() => {
const selectedHiddenValue = useMemo(() => {
// todo, map list of options to get the value
return '';
}, [selectedValue, formKey]);
Expand Down Expand Up @@ -147,7 +147,7 @@ const Combobox = forwardRef<HTMLInputElement, ComboboxProps>(
[listboxRef]
);

const hasOpaqueFormValue = formKey && formKey !== 'value' && name;
const hasHiddenFormValue = formKey && formKey !== 'value' && name;

useEffect(() => {
if (!isAutoComplete) {
Expand Down Expand Up @@ -394,8 +394,8 @@ const Combobox = forwardRef<HTMLInputElement, ComboboxProps>(
className={classnames('Combobox', className)}
ref={comboboxRef}
>
{hasOpaqueFormValue && (
<input type="hidden" name={name} value={selectedOpaqueValue} />
{hasHiddenFormValue && (
<input type="hidden" name={name} value={selectedHiddenValue} />
)}
<label
className={classnames('Field__label', {
Expand Down Expand Up @@ -423,7 +423,7 @@ const Combobox = forwardRef<HTMLInputElement, ComboboxProps>(
type="text"
id={`${id}-input`}
ref={inputRef}
name={hasOpaqueFormValue ? undefined : name}
name={hasHiddenFormValue ? undefined : name}
value={value}
role="combobox"
aria-autocomplete={!isAutoComplete ? 'none' : 'list'}
Expand Down

0 comments on commit 3fae2a9

Please sign in to comment.