Open ShadowLNC opened 5 years ago
Wrapping in another element didn't help me (I wrapped in a span). What does make a difference is if there is text or a placeholder in the field (you can enter text into it and the tab out to see the alignment jump). I placeholder of a non-breaking space kind of works, but it still doesn't align as well as an actual letter (metrics seem to be different).
Yes, came upon the exact same issue and would love to see it fixed. Thank you for the suggestion with the placeholder hack! Silly, but it works.. ¯_(ツ)_/¯
Just had this issue as well.
Seems like an issue has been filed with WebKit: https://bugs.webkit.org/show_bug.cgi?id=142968
The same issue is still present on desktop Safari 14.1.1 (latest stable release as of 4 June 2021.)
I fixed this by specifying: placeholder=" "
on all input fields where I wanted to leave the empty input field.
On iOS Safari,
align-items
uses the bottom of theinput
element for baseline calculations. iOS versions verified: 10.3, 12.1Example code
The first example (and second example in screenshot) aligns the
label
baseline with the bottom of theinput
element. The correct behaviour only occurs for the last example (with a parentdiv
). This also applies fortextarea
elements.A workaround is shown in the demo - in short, wrap your
input
tag in a parentdiv
. Unfortunately CSS selectors will need to be reworked appropriately. Edit: This workaround has limited success but does work for basic inputs. I'm still searching for other workarounds fortextarea
elements, etc.