Placeholder text for text areas indent
Hi I have created an app with ionic b13 that uses a text area with a placeholder text.
When the text area gets focus, the cursor and placeholder are not aligned correctly.
See photo

I have also found that setting text-align to 5px (the padding size) fixes the problem (the ion-content has padding="true"):
//ionic.css line 5167 input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: #aaaaaa; text-indent: 0; }
change text-indent to 5x px if padding.
Btw, further up (line 5137) that style sheet this rule defined: textarea::-webkit-input-placeholder { color: #aaaaaa; text-indent: -3px; }
But that gets overridden by the one further down in the stylesheet.
Maybe I did not state it clearly but the problem occurs in iOS (version 7.1 - I have only tested that), iPhone (I have only tested that).
This still occurs for me on beta 14.
Looking into this.
/* ----------- iPhone 4 and 4S ----------- */ @media only screen and (device-width: 320px) and (device-height: 480px) and (-webkit-min-device-pixel-ratio: 2) { textarea { text-indent: -3px; } }
/* ----------- iPhone 5 and 5S ----------- */ @media only screen and (device-width: 320px) and (device-height: 568px) and (-webkit-min-device-pixel-ratio: 2) { textarea { text-indent: -3px; } }
/* ----------- iPhone 6 ----------- */ @media only screen and (device-width: 375px) and (device-height: 667px) and (-webkit-min-device-pixel-ratio: 2) { textarea { text-indent: -3px; } }
/* ----------- iPhone 6+ ----------- */ @media only screen and (device-width: 414px) and (device-height: 736px) and (-webkit-min-device-pixel-ratio: 3) { textarea { text-indent: -3px; } }
@WinfredMa you can use platform specific body class to style textarea in all apple devices.
.platform-ios textarea,
.platform-ipad textarea {
text-indent: -3px;
}
Thanks! Got this in there and it's looking a lot better. We needed the text-indent on the textarea itself not the placeholder
How about for multiline textareas? it's only the first line that gets indented

Yea, that solution is problematic. Reverting for now: 535b96bad19fd3682927c00b6eed5840cc08b2c5
Hey everyone I think I found a solution without using text-indent (which only seems to work for the first line). Hope this helps!
textarea::placeholder { padding-left:3px }
textarea{ margin-left:-3px }
@JCsplash thanks for that tip. Your placeholder wasn't working for Safari Mobile so I added some webkit lines to it. I got it working with this code below:
/* iPhone fix */
.platform-ios textarea,
.platform-ipad textarea {
}
.platform-ios textarea::-webkit-input-placeholder,
.platform-ipad textarea::-webkit-input-placeholder {
padding-left:3px !important;
}
.platform-ios textarea:-moz-placeholder,
.platform-ipad textarea:-moz-placeholder { /* Firefox 18- */
padding-left:3px !important;
}
.platform-ios textarea::-moz-placeholder,
.platform-ipad textarea:-moz-placeholder { /* Firefox 19+ */
padding-left:3px !important;
}
.platform-ios textarea:-ms-input-placeholder,
.platform-ipad textarea:-moz-placeholder {
padding-left:3px !important;
}
.platform-ios textarea,
.platform-ipad textarea {
margin-left:-3px !important;
}
Hello all! Is this still an issue with the latest version of ionic? Thanks!
Hello all! As it seems it has been a while since there was any activity on this issue i will be closing it for now. Feel free to comment if you are still running into this issue. Thanks for using Ionic!
This issue is still present in RC2, negative text-indent helped me

this worked for me:
.platform-ios {
textarea {
margin-left: -3px;
&::placeholder {
padding-left: 3px;
}
}
}
Hello,
Do check the blog post for supported CSS properties on placeholders.
https://blog.ajcw.com/2011/02/styling-the-html5-placeholder/
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.