P
P
person982019-03-18 13:02:24
Angular
person98, 2019-03-18 13:02:24

How to switch to the first item in a select dropdown list after the last one?

In general, there is a drop-down list.
5c8f6a5924a89561813726.png
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

1 answer(s)
A
Alexey P, 2019-03-28
@lynxp9

See this question https://stackoverflow.com/questions/42230996/angul...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question