Stacked Label Input value position is not fixed on focus
See original GitHub issueWhen focusing a stacked label input the position of the input text moves up some pixels. See attached screenshots.
react-native, react and native-base version
"dependencies": {
"native-base": "2.3.10",
"react": "^16.3.0-alpha.1",
"react-native": "0.54.2"
}
Expected behaviour
Text should be fixed at same position as before the focus. The original text position should be positioned aligned with the placeholder. Instead the original text position is below the placeholder with some pixels.
Actual behaviour
Unfocused input
When focusing the input the input text moves up some pixels
Steps to reproduce (code snippet or screenshot)
<Container>
<Content style={{paddingTop: 100}}>
<Item stackedLabel>
<Label>{"Stacked Label"}</Label>
<Input value={'value'} />
</Item>
</Content>
</Container>
Is the bug present in both ios and android or in any one of them?
The issue is strangely only present on ios and not android. fixedLabel has the same issue (and maybe other input label types as well)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:26 (9 by maintainers)
Top Results From Across the Web
How to position input label at the top if input has a value
1 Answer 1 · Set inital value of input to "" and set the input value when keyup using Javascript. · On CSS...
Read more >lightning-input - documentation
When the input field is focused, the input value is the multiplied number. For example, entering 1k results in 1,000 on blur, and...
Read more >Forms
Examples and usage guidelines for form control styles, layout options, and custom components for creating a wide variety of forms.
Read more >Input
By only using the traditional label[for] method, the fixed text is never read out in the context of editing the input value. With...
Read more >Z-index and stacking contexts - web.dev
In normal flow, if you set a specific value for z-index and it isn't working, you need to set the element's position value...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@SupriyaKalghatgi It’s because you are not setting a value directly on the Input tag.
Try setting the value with a value from the state like this:
and then you will get the following result:
This bug makes me crazy As said @idrakimuhamad, @andidev workaround by setting lineHeight to null help to overcome this.