I am currently working on creating a dropdown with decrement/increment buttons, similar to the one shown in the image below:
https://i.sstatic.net/nTC9Z.jpg
Here is the code I have so far:
<div class="dropdown">
<button class="btn border-0 dropdown-toggle form-control" type="button"
id="dropdownMenu2" data-toggle="dropdown" aria-expanded="false">
Dropdown</button>
<div class="dropdown-menu" style="width: 250px; background-color: #343a40"
aria-labelledby="dropdownMenu2">
<div class="dropdown-item">
<div class="row text-white">
<div class="col-md">
<i class="fa fa-user mr-2"></i>Adult</div>
<div class="col-md text-center">
<button class="btn btn-sm btn-success mx-2">+</button>
<span>1</span>
<button class="btn btn-sm btn-success mx-2">+</button>
</div>
</div>
</div>
</div>
I have been able to make it this far, but I am facing issues where the page scrolls to the top when the button inside the dropdown is clicked, and I also do not like the background color changes when hovering over the dropdown item. Can someone please help me fix these issues? Thank you.
UPDATE: The only thing left to do is prevent the page from scrolling when the button inside the dropdown is clicked. Can anyone provide assistance with this?