Skip to content

Using onclick in html template literal throws an error #1092

Closed
@AkromDev

Description

@AkromDev

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)
    Screen Shot 2023-02-14 at 14 56 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions