mirror of
https://github.com/dzeiocom/components.git
synced 2025-04-22 02:42:12 +00:00
Readonly select will be basic readonly inputs
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
parent
1d0108ac80
commit
60b7e187fe
@ -97,7 +97,7 @@ export default class Input extends React.Component<Props, States> {
|
||||
baseProps.onWheel = (ev: React.WheelEvent<HTMLInputElement>) => ev.currentTarget.blur()
|
||||
}
|
||||
|
||||
if (this.props.type === 'select') {
|
||||
if (this.props.type === 'select' && !this.props.readOnly) {
|
||||
input = (
|
||||
<select
|
||||
ref={this.props.selectRef || this.inputRef}
|
||||
@ -112,6 +112,15 @@ export default class Input extends React.Component<Props, States> {
|
||||
{this.props.children}
|
||||
</select>
|
||||
)
|
||||
// select is readonly
|
||||
} else if (this.props.type === 'select') {
|
||||
input = (
|
||||
<input
|
||||
{...props}
|
||||
{...baseProps}
|
||||
type="text"
|
||||
/>
|
||||
)
|
||||
} else if (this.props.type === 'textarea') {
|
||||
delete baseProps.ref
|
||||
input = (
|
||||
|
Loading…
x
Reference in New Issue
Block a user