Skip to content

Commit

Permalink
fix(auth): fix console errors
Browse files Browse the repository at this point in the history
  • Loading branch information
royschut committed Aug 6, 2021
1 parent d251b26 commit e293764
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/components/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,24 @@ const Dropdown: React.FC<Props & React.AriaAttributes> = ({
</label>
)}
<div className={classNames(styles.dropdown, { [styles.fullWidth]: fullWidth })}>
<select id={id} className={styles.select} name={name} value={value} onChange={onChange} aria-required={required} {...rest}>
<select
id={id}
className={styles.select}
name={name}
value={value}
onChange={onChange}
aria-required={required}
defaultValue={defaultLabel}
{...rest}
>
{defaultLabel && (
<option className={classNames(styles.option, optionsStyle)} value="" disabled={required} selected={value === ''}>
<option className={classNames(styles.option, optionsStyle)} value="" disabled={required}>
{defaultLabel}
</option>
)}
{options &&
options.map((option) => (
<option className={classNames(styles.option, optionsStyle)} key={option} value={option} selected={value === option}>
<option className={classNames(styles.option, optionsStyle)} key={option} value={option}>
{valuePrefix}
{option}
</option>
Expand Down
1 change: 1 addition & 0 deletions src/components/PersonalDetailsForm/PersonalDetailsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const PersonalDetailsForm: React.FC<Props> = ({
error: !!questionErrors[key],
helperText: questionErrors[key],
required,
key,
};

if (values.length === 1) {
Expand Down

0 comments on commit e293764

Please sign in to comment.