Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'alignItems' container style breaks the input fields

See original GitHub issue

Hi! When you place FloatingLabelInputs inside a View container which has the alignItems style set to something different than 'stretch' (default), these inputs don’t work properly. They are very narrow, placeholders go out of borders and the user input itself isn’t visible. I’ve tried setting width for the inputs to fix it, but it doesn’t solve the issue - entered text gets cropped and is still not visible.

On the image below, the password field has it’s style set to width: '80%' and the style of the container View is set to alignItems: 'center' floating-labels-input-bug

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

pawicaocommented, Aug 23, 2020

You are right - mistake simple as that 😉

It seems that everything is working properly now. Thanks for the fix

Cniltoncommented, Aug 22, 2020

@pawicao, sorry but I think you’re using the margin or padding at the wrong style prop. If you want the margin to affect the area around the input, use the containerStyles prop as the image shows:


If you can confirm this is working as intended, we can close this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

align-items - CSS: Cascading Style Sheets - MDN Web Docs
The flex items' margin boxes are centered within the line on the cross-axis. If the cross-size of an item is larger than the...
Read more >
align-items - CSS-Tricks
The align-items property is related to CSS layout. It effects how elements are aligned both in Flexbox and Grid layouts.
Read more >
input / button elements not shrinking in a flex container
This means that items cannot shrink below their width on the main axis. Hence, input elements cannot shrink below their default width and...
Read more >
CSS align-items property - W3Schools
The align-items property specifies the default alignment for items inside the flexible container. Tip: Use the align-self property of each item to override ......
Read more >
Align Items - Tailwind CSS
Utilities for controlling how flex and grid items are positioned along a container's cross axis.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found