(e)
| 89 | } |
| 90 | |
| 91 | handleDocumentClick(e) { |
| 92 | if ( |
| 93 | e && |
| 94 | (e.which === 3 || (e.type === 'keyup' && e.which !== keyCodes.tab)) |
| 95 | ) |
| 96 | return; |
| 97 | const container = this.getContainer(); |
| 98 | const menu = this.getMenu(); |
| 99 | const toggle = this.getToggle(); |
| 100 | |
| 101 | // Add a conditional check to avoid using toggle |
| 102 | // if there is no toggle component in the dropdown |
| 103 | if (!toggle) { |
| 104 | return; |
| 105 | } |
| 106 | |
| 107 | const targetIsToggle = toggle.contains(e.target); |
| 108 | |
| 109 | const clickIsInMenu = menu && menu.contains(e.target) && menu !== e.target; |
| 110 | |
| 111 | let clickIsInInput = false; |
| 112 | if (container) { |
| 113 | // This is only for InputGroup with type dropdown |
| 114 | clickIsInInput = |
| 115 | container.classList.contains('input-group') && |
| 116 | container.classList.contains('dropdown') && |
| 117 | e.target.tagName === 'INPUT'; |
| 118 | } |
| 119 | |
| 120 | if ( |
| 121 | ((targetIsToggle && !clickIsInInput) || clickIsInMenu) && |
| 122 | (e.type !== 'keyup' || e.which === keyCodes.tab) |
| 123 | ) { |
| 124 | return; |
| 125 | } |
| 126 | |
| 127 | this.toggle(e); |
| 128 | } |
| 129 | |
| 130 | handleKeyDown(e) { |
| 131 | const isTargetMenuItem = |
nothing calls this directly
no test coverage detected