1

here i have a issue i am generating a dynamic dropdown and trying to set the scroll for dropdown using Overflow-y:auto in some scenario people are suggesting to use size="5" some number but thats works for long selection box not for dropdown.

1.How can I set scroll for dropdown ?
2.How can I set caret up n down for down ?

<select>
  <option value="none" disabled >Select Data</option>
  <option *ngFor="let data of dropdownData">{{data.name}}</option>
</select>

enter image description here

stackblitz url : https://stackblitz.com/edit/angular-mirzns

Vega
  • 27,856
  • 27
  • 95
  • 103
Dexter
  • 518
  • 3
  • 12
  • 40
  • it may help you:https://stackoverflow.com/questions/24119643/html-select-tag-show-vertical-scroll-with-10-option – לבני מלכה Jan 20 '19 at 10:10
  • @Vega usually i have a dropdown so i thought what if the the items in dropdown increases – Dexter Jan 20 '19 at 16:52
  • 1
    Never mind, I mixed the dropdown and the selection box. But, if you set either size="5" on select or max-height in css and overflow:scroll, you should get a scrolling dropdown https://stackblitz.com/edit/angular-uny5cq – Vega Jan 20 '19 at 16:58
  • ok but i set size ="5" and overflow:scroll also but i didnt get scrollable dropdown – Dexter Jan 20 '19 at 17:16
  • @Vega https://stackblitz.com/edit/angular-uny5cq – Dexter Jan 20 '19 at 17:38
  • @Vega check my update question with image and actually i need like in dropdown i need scroll able but here im getting like selection box in chrome im testing – Dexter Jan 20 '19 at 17:43
  • @Vega a small help could u once check this issue n let me know what i am missing https://stackoverflow.com/questions/54278724/facing-issue-with-bootstrap-card-unable-to-set-height-equally-in-carousel-using?noredirect=1#comment95380014_54278724 – Dexter Jan 20 '19 at 17:45
  • A drop-down normally opens items if it is having large items then it's don't look good for a normal select drop-down only can't we have scroll and have u checked my other stack link which I posted to you in comment ? – Dexter Jan 20 '19 at 18:00
  • @Dexter, are you looking for this: https://stackblitz.com/edit/angular-ahzi76 – Vega Jan 20 '19 at 18:29
  • @Vega no actually for getting the scroll in select dropdown pple are using ul & li element and then they are implementing it – Dexter Jan 28 '19 at 14:36

0 Answers0