File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,9 +11,17 @@ export function bind(controller: HTMLElement) {
1111 // Match the pattern of `eventName:constructor#method`.
1212 for ( const binding of ( el . getAttribute ( 'data-action' ) || '' ) . split ( ' ' ) ) {
1313 const [ rest , method ] = binding . split ( '#' )
14- const [ eventName , handler ] = rest . split ( ':' )
14+
15+ // eventName may contain `:` so account for that
16+ // by splitting by the last instance of `:`
17+ const colonIndex = rest . lastIndexOf ( ':' )
18+ if ( colonIndex < 0 ) continue
19+
20+ const handler = rest . slice ( colonIndex + 1 )
1521 if ( handler !== tag ) continue
1622
23+ const eventName = rest . slice ( 0 , colonIndex )
24+
1725 // Check the `method` is present on the prototype
1826 const methodDescriptor = Object . getOwnPropertyDescriptor ( Object . getPrototypeOf ( controller ) , method )
1927 if ( methodDescriptor && typeof methodDescriptor . value == 'function' ) {
You can’t perform that action at this time.
0 commit comments