Created by: tkrotoff
Following https://github.com/twbs/bootstrap/issues/19991#issuecomment-606050071
3 commits
Replace event.which
KeyboardEvent.which and MouseEvent.which are deprecated/non standard.
It's a relic from the jQuery time.
Replaced with KeyboardEvent.key and MouseEvent.button.
Remove event.delegateTarget inside event-handler.js
event.delegateTarget is only used by tooltip, replacing it with event.target works fine, thus no more fixEvent().
Fix crash in dropdown: "Uncaught TypeError: Cannot read property 'focus' of undefined"
While working on this, I've noticed a crash when opening the dropdown and pressing ArrowUp for the first time. Crash already present here: https://twbs-bootstrap.netlify.com/docs/4.3/components/dropdowns/
items.indexOf(event.target) || 0
gives -1 || 0
which returns... -1
... See explanations "Why are JavaScript negative numbers not always true or false?"
Testing
All tests passing, manually tested (dropdown, tooltip, carousel, tooltip) under macOS with Chrome 81, Firefox 75 and Safari 13.1.