* Handle the user clicking an option. * @param option The option that was clicked.
(option: CdkOption<T>, event: MouseEvent)
| 960 | * @param option The option that was clicked. |
| 961 | */ |
| 962 | private _handleOptionClicked(option: CdkOption<T>, event: MouseEvent) { |
| 963 | event.preventDefault(); |
| 964 | this.listKeyManager.setActiveItem(option); |
| 965 | if (event.shiftKey && this.multiple) { |
| 966 | this.triggerRange( |
| 967 | option, |
| 968 | this._getLastTriggeredIndex() ?? this.listKeyManager.activeItemIndex!, |
| 969 | this.listKeyManager.activeItemIndex!, |
| 970 | !option.isSelected(), |
| 971 | ); |
| 972 | } else { |
| 973 | this.triggerOption(option); |
| 974 | } |
| 975 | } |
| 976 | |
| 977 | /** Verifies that no two options represent the same value under the compareWith function. */ |
| 978 | private _verifyNoOptionValueCollisions() { |
no test coverage detected