Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Dropdown data-toggle="dropdown" element click events not bubble #30267

@njake

Description

@njake

_addEventListeners function has two functions to prevent default link actions.
event.preventDefault()
event.stopPropagation()

If link element is not used for toggle, disabling events are not nesessary at all?

Reason is i need attach events to all toggle elements to get click events wanted from toggle elements.
Better way is to attach single event listener to parent and use event.target, this is not working now.

Is it possible to add check if toggle element is link, then add those events something like:
if(this._element.nodeName == 'a'){ event.preventDefault(); event.stopPropagation(); }
or using data attribute to disable/enable bubling.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions