Using `onclick` in `html` template literal throws an error

Hello, I integrated vanilla autocomplete to handlebars project and I am using html template literal to return UI for header and item in templates object.

But using onclick in html literal is throwing the error below.

`this.l[(l.type + false)] is not a function`. 

I tried using both global and window methods (which is global) but I got the same error nevertheless.

Steps to reproduce:

  • Open this codesandbox (modified version of recently viewed example to use html literal)
  • Search something and click Alert or Global button
  • Confirm that clicking either of these buttons throw an error
  • Notice clicking buttons in regular html works fine (buttons below search input)

It is resolved now.
I was able to get a reply in my github issue

1 Like