ion-label does not float properly with ion-textarea
See original GitHub issueBug Report
Ionic version: [x] 4.x
Current behavior:
When a default value is present for an ion-textarea, the ion-label does not float properly. Ion-item css styles shows the css class item-input
instead of item-has-value
. This behavior is observed using latest beta.16
of ionic/angular
The behavior corrects when focus has been applied to the ion-textarea.
Expected behavior: When an ion-textarea has a value, the label should float properly.
Steps to reproduce:
Related code:
<ion-list inset>
<ion-item no-padding>
<ion-label position="floating">Status</ion-label>
<ion-select formControlName="status">
<ion-select-option value="New">New</ion-select-option>
<ion-select-option value="Processing">Processing</ion-select-option>
<ion-select-option value="Accepted">Accepted</ion-select-option>
<ion-select-option value="Rejected">Rejected</ion-select-option>
<ion-select-option value="Cancelled">Cancelled</ion-select-option>
</ion-select>
</ion-item>
<ion-item no-padding>
<ion-label position="floating">Incident Date</ion-label>
<ion-datetime formControlName="incidentDate" displayFormat="DD MMM YYYY"></ion-datetime>
</ion-item>
<ion-item no-padding>
<ion-label position="floating">Description</ion-label>
<ion-textarea formControlName="description" type="text" rows="5" required="true"></ion-textarea>
</ion-item>
</ion-list>
Other information:
Ionic info:
Ionic:
ionic (Ionic CLI) : 4.4.0
Ionic Framework : @ionic/angular 4.0.0-beta.16
@angular-devkit/build-angular : 0.12.3
@angular-devkit/schematics : 7.0.7
@angular/cli : 7.0.7
@ionic/angular-toolkit : 1.2.0
System:
NodeJS : v8.12.0 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (5 by maintainers)
Top Results From Across the Web
ion-label does not float properly with ion-textarea · Issue #17555
When a default value is present for an ion-textarea, the ion-label does not float properly. Ion-item css styles shows the css class ...
Read more >How to position floating ion-label inside ion-text-area?
Just place your ion-label in "front" of your ion-textarea using z-index css attribute. I suggest you do something like this to achieve ...
Read more >ion-input: Custom Input Value Type Styling and CSS Properties
ion-input is a wrapper to the HTML input element, with custom value type styling and ... <ion-label position="floating">Floating label</ion-label>
Read more >Advanced Forms & Validation in Ionic & Angular | Josh Morony
A FormControl is tied to an input field, it has a value (i.e. the value the user has entered), and a validation state...
Read more >Ion-item text-wrap, Ion input multi line, Ion text area in Ionic 4 ...
Current behavior: When a default value is present for an ion-textarea, the ion-label does not float properly. Ion-item css styles shows the css...
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
version 4.3.0 definitely resolves the issue for us
Thanks so much @mburger81! That helps a lot. I confirmed that this happens to textarea with a setTimeout on it in core, without Angular. It does not happen to the
ion-input
. Here’s a Codepen reproducing it: https://codepen.io/brandyscarney/pen/XQgwJMI’ll add it to the project. I think the problem is as simple as
this.emitStyle()
not being called on value change:I’ll take a quick look at this.