Skip to content

onClickBefore callback: e.defaultPrevented doesn't work and should be replaced with e.isDefaultPrevented() #117

@ethaniel

Description

@ethaniel

Hi,

I am working with the onClickBefore callback to stop typeahead from updating the input field with the currently selected result.

I noticed that in the code right after the callback you check if I called "e.preventDefault();" by checking for e.defaultPrevented.
However, this is not correct, because "e" is not the original event, it is a jquery result, which for some stupid reason doesn't have the defaultPrevented attribute.

Easy fix. Replace e.defaultPrevented with e.isDefaultPrevented()

jQuery documentation: http://api.jquery.com/event.isDefaultPrevented/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions