🐛 Fixing select in forms
This commit is contained in:
parent
699b85bc41
commit
281126df6d
@ -14,6 +14,7 @@ type IProps = {
|
|||||||
hasBorderRightCollapsed?: boolean;
|
hasBorderRightCollapsed?: boolean;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
name?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type IOption = {
|
export type IOption = {
|
||||||
@ -50,6 +51,7 @@ export default class Select extends React.Component<IProps, IState> {
|
|||||||
const selectedOption = this.state.selectedOption ?? this.props.selectedOption;
|
const selectedOption = this.state.selectedOption ?? this.props.selectedOption;
|
||||||
return (
|
return (
|
||||||
<div className={classNames(classes["root"], this.props.className)} ref={this.rootRef}>
|
<div className={classNames(classes["root"], this.props.className)} ref={this.rootRef}>
|
||||||
|
{selectedOption && <input type="text" defaultValue={selectedOption.value as string} name={this.props.name} hidden />}
|
||||||
<label
|
<label
|
||||||
className={classNames(classes["container-label"])}
|
className={classNames(classes["container-label"])}
|
||||||
data-open={this.state.isOpen}
|
data-open={this.state.isOpen}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user