File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @travelopia/web-components" ,
3- "version" : " 0.5.17 " ,
3+ "version" : " 0.5.18 " ,
44 "description" : " Accessible web components for the modern web" ,
55 "files" : [
66 " dist"
Original file line number Diff line number Diff line change @@ -13,16 +13,24 @@ export class TPMultiSelectPillElement extends HTMLElement {
1313 connectedCallback ( ) : void {
1414 this . querySelector ( 'button' ) ?. addEventListener ( 'click' , this . handleButtonClick . bind ( this ) ) ;
1515 }
16-
1716 /**
1817 * Handle button click.
1918 *
20- * @param {Event } e Click event.
19+ * @param {any } e Click event.
2120 */
22- handleButtonClick ( e : Event | null ) : void {
21+ handleButtonClick ( e : any | null ) : void {
2322 e ?. preventDefault ( ) ;
2423 e ?. stopPropagation ( ) ;
25- this . removePill ( ) ;
24+
25+ /**
26+ * If the event is has a pointerType, which means it's a mouse event or touch event
27+ * Only then we remove pill.
28+ * This will ensure, it will not get fired when a enter button is pressed.
29+ * We do this so that it does not remove the pills when enter button is pressed.
30+ */
31+ if ( e ?. pointerType ) {
32+ this . removePill ( ) ;
33+ }
2634 }
2735
2836 /**
You can’t perform that action at this time.
0 commit comments