Tried using the 'zindex' prop, as suggested here: https://github.com/facebook/react/issues/1456
<Input ref="username" type="text" label="Username"
placeholder="Enter username" zindex={1} />
Doesn't work. Also tried 'zindex="1"'
Any ideas?
Tried using the 'zindex' prop, as suggested here: https://github.com/facebook/react/issues/1456
<Input ref="username" type="text" label="Username"
placeholder="Enter username" zindex={1} />
Doesn't work. Also tried 'zindex="1"'
Any ideas?
you need to assign it using the style={} construct. Try this:
<Input ref="username" type="text" label="Username" placeholder="Enter username" style={{zIndex:1}} />
always remember to use camel case.
z-index
becomes zIndex
.
margin-right
becomes marginRight
.
you must call style.
style={{ zIndex = 1}}
you may want to pass relative or absolute.
<div style={{ position: 'relative', zIndex: '1' }}>
bottom
</div>
<div style={{ position: 'relative', zIndex: '2' }}>
top
</div>
<Input ref="username" type="text" label="Username" placeholder="Enter username" zindex={1} />
Sometimes you may need to use !important
to force your style being applied.
Example:
style={{ zIndex: '1 !important' }};
when you are applying z-index then definitely you are trying to priorities your new part of code. So you also need to check if there are any other z-index with higher value which might be restricting your new z-index value
<Input ref="username" type="text" label="Username"
placeholder="Enter username" class = "applyZIndex" />
.applyZIndex {
z-index : 1;
}
This works for me: style={{zIndex:1}}