mirror of
https://github.com/dzeiocom/components.git
synced 2025-04-22 10:52:16 +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()
|
baseProps.onWheel = (ev: React.WheelEvent<HTMLInputElement>) => ev.currentTarget.blur()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.props.type === 'select') {
|
if (this.props.type === 'select' && !this.props.readOnly) {
|
||||||
input = (
|
input = (
|
||||||
<select
|
<select
|
||||||
ref={this.props.selectRef || this.inputRef}
|
ref={this.props.selectRef || this.inputRef}
|
||||||
@ -112,6 +112,15 @@ export default class Input extends React.Component<Props, States> {
|
|||||||
{this.props.children}
|
{this.props.children}
|
||||||
</select>
|
</select>
|
||||||
)
|
)
|
||||||
|
// select is readonly
|
||||||
|
} else if (this.props.type === 'select') {
|
||||||
|
input = (
|
||||||
|
<input
|
||||||
|
{...props}
|
||||||
|
{...baseProps}
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
|
)
|
||||||
} else if (this.props.type === 'textarea') {
|
} else if (this.props.type === 'textarea') {
|
||||||
delete baseProps.ref
|
delete baseProps.ref
|
||||||
input = (
|
input = (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user