Dropdown is missing some features from the jquery bootstrap library
- Support input/textarea in dropdown (click without closing)
- Arrow key navigation, ui-bootstrap handles this incorrectly and the page still scrolls when using arrows.
- Not close when clicking a disabled dropdown element
- Close on outside touch/tap (mobile). Current document:click is mouse only and IMO not a great option as it fires for every click for every dropdown active on your page. It also makes it more difficult to control what to auto close for as it loses track of where clicks are happening inside the dropdown vs outside.
I’ve got some of these features on my own implementation that I no longer want to maintain and would rather use this project.
I can make a pull request, but pretty much all of them require moving away from document:click towards another solution. I’ve placed a div with .dropdown-backdrop (like jquery bootstrap) that captures both taps and clicks when the dropdown is open, however this also catches the click and prevents clicks on lower levels from happening. So on
<button>Outside</button><div ngbDropdown [open]="true"></div>
the button won’t be clicked because the dropdown-backdrop captures the click, so button requires two clicks to activate. It could be possible to show the backdrop only when a touchstart is detected that way it’s only shown for mobile users.
Let me know your thoughts.