We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 287086c + c89de9a commit 7430ca4Copy full SHA for 7430ca4
src/multi-select/tp-multi-select-search.ts
@@ -92,8 +92,15 @@ export class TPMultiSelectSearchElement extends HTMLElement {
92
* @param {Event} e Click event.
93
*/
94
protected handleClick( e: Event ): void {
95
+ // First, prevent propagation to avoid document.click set on `tp-multi-select`.
96
e.preventDefault();
97
e.stopPropagation();
98
+
99
+ // Now send the event so other stuff can work as per normal, and another event for good measure.
100
+ this.dispatchEvent( new CustomEvent( 'multi-select-opened' ) );
101
+ document.dispatchEvent( new Event( 'click' ) );
102
103
+ // Open multi select.
104
this.closest( 'tp-multi-select' )?.setAttribute( 'open', 'yes' );
105
}
106
0 commit comments