'Remove initial text from ngb-timepicker

I am using this: https://ng-bootstrap.github.io/#/components/timepicker/examples

Copy pasted the following code:

<ngb-timepicker [(ngModel)]="time"></ngb-timepicker>

The result should be like this:
enter image description here

But it is different in a sense that annoying texts appear:
enter image description here

How to remove them? The api documentation doesn't mention anything about this.



Solution 1:[1]

those elements have class sr-only. It is a bootstrap class. According to docs:

Use screenreader utilities to hide elements on all devices except screen readers

Looks like the styles you use in the project. You might miss some css from bootstrap or some nasty things overrides the .sr-only styles.

Solution 2:[2]

In my case, the bootstrap css wasn't properly applied in my Angular project. I had to add following line in the global styles.css.

@import url("https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css");

Solution 3:[3]

The solution is the next:

<ngb-timepicker [(ngModel)]="time" [spinners]="false"></ngb-timepicker>

Those are called "spinners" and are set as "true" by default. Hope it works for you!

Solution 4:[4]

fast resolve

styles: [`
    .visually-hidden{
    display: none !important;
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 IAfanasov
Solution 2 Pawan
Solution 3 jwilliams
Solution 4 Eiker Gonzalez