Answer the question
In order to leave comments, you need to log in
How to switch to the first item in a select dropdown list after the last one?
In general, there is a drop-down list.
When I do navigation down, of course, the result will show me the selected element, and when I select the last element, then I have to press the down button again and the result will be the first element.
As well as from the first element immediately switch to the last by pressing the up button ^
<div class="col-6" class="mt-5">
<select class="custom-select" [(ngModel)]="result">
<option *ngFor=" let item of items"> {{item}}</option>
</select>
</div>
import { Component } from '@angular/core';
@Component({
selector: 'app-select',
templateUrl: './select.component.html',
styleUrls: ['./select.component.css']
})
export class SelectComponent {
result = '';
items = ['ItemOne', 'ItemTwo', 'ItemThree'];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question