Skip to content

JQueryEvents do not stop propagation when Event.stopPropagaion() is called #22

@FreexD

Description

@FreexD

JQueryEvent extends org.scalajs.dom.Event and thus should be handled by handlers declared with Element.addEventListener but this does not seem to be the case.

"stop propagation of JQueryEvents when Events stop their propagation" in {
      val element = div().render
      val wrapperElement = div(element).render

      element.addEventListener(EventName.click, { event: Event => event.stopImmediatePropagation() })

      var counter = 0
      jQ(wrapperElement).on(EventName.click, (_, _) => counter += 1)

      jQ(element).trigger(EventName.click)
      counter should be(0)
    }

I've added a test checking that behaviour and it fails and IMHO it shouldn't. Commit: 662ac1d

Metadata

Metadata

Assignees

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