File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @travelopia/web-components" ,
3- "version" : " 0.5.7 " ,
3+ "version" : " 0.5.8 " ,
44 "description" : " Accessible web components for the modern web" ,
55 "files" : [
66 " dist"
Original file line number Diff line number Diff line change @@ -28,10 +28,16 @@ export class TPMultiSelectOptionElement extends HTMLElement {
2828
2929 if ( 'yes' !== this . getAttribute ( 'selected' ) ) {
3030 multiSelect ?. select ( value ) ;
31- multiSelect ?. dispatchEvent ( new CustomEvent ( 'select' , { bubbles : true } ) ) ;
31+ multiSelect ?. dispatchEvent ( new CustomEvent ( 'select' , {
32+ bubbles : true ,
33+ detail : { value } ,
34+ } ) ) ;
3235 } else {
3336 multiSelect ?. unSelect ( value ) ;
34- multiSelect ?. dispatchEvent ( new CustomEvent ( 'unselect' , { bubbles : true } ) ) ;
37+ multiSelect ?. dispatchEvent ( new CustomEvent ( 'unselect' , {
38+ bubbles : true ,
39+ detail : { value } ,
40+ } ) ) ;
3541 }
3642 multiSelect ?. dispatchEvent ( new CustomEvent ( 'change' , { bubbles : true } ) ) ;
3743 }
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export class TPMultiSelectSearchElement extends HTMLElement {
6767 let matchedOptionCount = 0 ;
6868 // Hide and show options based on search.
6969 options . forEach ( ( option : TPMultiSelectOptionElement ) : void => {
70- if ( option . getAttribute ( 'value ' ) ?. match ( new RegExp ( `.*${ search . value } .*` ) ) ) {
70+ if ( option . getAttribute ( 'label ' ) ?. toLowerCase ( ) . match ( new RegExp ( `.*${ search . value . replace ( / \s / g , '.*' ) } .*` ) ) ) {
7171 option . removeAttribute ( 'hidden' ) ;
7272 matchedOptionCount ++ ;
7373 } else {
You can’t perform that action at this time.
0 commit comments