Selected option not shown (angular, html)

439 Views Asked by At

I have the following angular template form :

<label for="operationType" class="form-control">Operation</label>
            <select name="operationType" [(ngModel)]="operationType" (change)="setOperationType()">
                <option *ngFor="let operation of operationsList" value={{operation.value}} >{{operation.name}}</option>
            </select>

The problem is that the selected option is not show on my page.

I try different browser, the selected option is shown in safari but not in chrome et firefox. I don't know if it is a problem of browser.

Can you help?

1

There are 1 best solutions below

0
On

The problem was my css :

select {
    width: 100%;
    height : 20px;
    padding: 12px 20px;
    margin-bottom: 50px;;
    margin: 8px 0px;
    border: 1px solid #ccc;
    border-radius: 4px;

  }

The padding was too high so I couldn't see the text.