I am using Angular 17 with PrimeNG and I have an issue where p-floatLabel doesn’t work as intended. There’s no error anywhere but the label doesn’t float.
I don’t know what I’m supposed to do.
Here’s my html:
<div>
<p-floatLabel>
<input pInputText id="username"/>
<label for="username">Username</label>
</p-floatLabel>
</div>
Also, here’s the beginning of my component:
import { Component } from '@angular/core';
import { ButtonModule } from 'primeng/button';
import { InputTextModule } from 'primeng/inputtext';
import { FloatLabelModule } from 'primeng/floatlabel';
import { CommonModule } from '@angular/common';
@Component({
selector: 'app-login',
standalone: true,
imports: [ButtonModule, InputTextModule, FloatLabelModule, CommonModule],
templateUrl: './login.component.html',
styleUrl: './login.component.sass'
})
The label and the input are shown, but the label isn’t doing what it is supposed to do according to PrimeNG
Thank you