Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/multi-select/tp-multi-select-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,15 @@ export class TPMultiSelectSearchElement extends HTMLElement {
* @param {Event} e Click event.
*/
protected handleClick( e: Event ): void {
// First, prevent propagation to avoid document.click set on `tp-multi-select`.
e.preventDefault();
e.stopPropagation();

// Now send the event so other stuff can work as per normal, and another event for good measure.
this.dispatchEvent( new CustomEvent( 'multi-select-opened' ) );
document.dispatchEvent( new Event( 'click' ) );

// Open multi select.
this.closest( 'tp-multi-select' )?.setAttribute( 'open', 'yes' );
}

Expand Down