🐛(react) fix Select submit button

As the default type of button is "submit", when including a Select
inside a form, clicking on any of its button was triggering form
submission.
This commit is contained in:
Nathan Vasse
2024-02-02 15:14:10 +01:00
committed by NathanVss
parent e79768c7ce
commit f16eed9a6d
3 changed files with 9 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"@openfun/cunningham-react": patch
---
fix Select submit button

View File

@@ -145,6 +145,7 @@ export const SelectMonoAux = ({
e.stopPropagation(); e.stopPropagation();
}} }}
icon={<span className="material-icons">close</span>} icon={<span className="material-icons">close</span>}
type="button"
/> />
<div className="c__select__inner__actions__separator" /> <div className="c__select__inner__actions__separator" />
</> </>
@@ -164,6 +165,7 @@ export const SelectMonoAux = ({
</span> </span>
} }
disabled={disabled} disabled={disabled}
type="button"
{...downshiftReturn.toggleButtonProps} {...downshiftReturn.toggleButtonProps}
/> />
</div> </div>

View File

@@ -125,6 +125,7 @@ export const SelectMultiAux = ({ children, ...props }: SelectMultiAuxProps) => {
props.onSelectedItemsChange([]); props.onSelectedItemsChange([]);
}} }}
icon={<span className="material-icons">close</span>} icon={<span className="material-icons">close</span>}
type="button"
/> />
<div className="c__select__inner__actions__separator" /> <div className="c__select__inner__actions__separator" />
</> </>
@@ -143,6 +144,7 @@ export const SelectMultiAux = ({ children, ...props }: SelectMultiAuxProps) => {
</span> </span>
} }
disabled={props.disabled} disabled={props.disabled}
type="button"
/> />
</div> </div>
<div className="c__select__inner__value"> <div className="c__select__inner__value">