问题
I have a super-simple Angular app:
<div ng-app>
<ul>
<li ng_if='true'>
<textarea placeholder='Hello'></textarea>
</li>
</ul>
</div>
That's it. No JS / CSS.
In FF (34.0 on OSX), the placeholder in the Textarea will not show up until the textarea is focused.
What I've discovered thus far:
- It's only on textarea. Text inputs are fine.
- It's only when it's within a child $scope. If the
ng-ifwasn't there, the issue would disappear.
Play around with it here.
I'm out of ideas. Any help would be super appreciated! :)
回答1:
This is a bug in Gecko, which has been resolved: https://bugzilla.mozilla.org/show_bug.cgi?id=1088158
The fix should be shipped in stable in a few months, but in the meantime, sorry for the inconvenience.
回答2:
This (ugly) work-around seems to work.
<div ng-app>
<ul>
<li ng_if='true'>
<textarea placeholder='Hello'>{{''}}</textarea>
</li>
</ul>
</div>
来源:https://stackoverflow.com/questions/27282323/firefox-and-angular-textarea-placeholder-doesnt-appear-until-first-focus