Skip to content

Event handler removed after callback fails #1573

Closed
@niahoo

Description

@niahoo

Hello,

I found what I think is a bug.

I listen to windows keyup events in a child component, so I can add and remove this component in a #if block (because my component is kind of a lightbox slideshow so most of the time it is not visible, so I want the event listeners to be removed).

In the parent component, I listen to the events fired by the child and handle them with a method.

What I found is that if the method throws an exception, the event handler of the parent will not be called anymore, but the child one still will be.

Here is an REPL demo.

Steps to reproduce :

  1. Go to the REPL and open your console (I tried chrome and Firefox, last stable ones)
  2. When loaded, click on the rendered area so the editor will not swallow keyboard events
  3. Push keys on your keyboard, but NOT the ArrowLeft key. You will see that the rendered area show what key you pushed. Look at the console, you will see logs from both components.
  4. Push the ArrowLeft key, you will see an exception in the console.
  5. Push keys on your keyboard, the View is not refreshed. Look at the console, you will see that the child component is handling window events, but not the parent component.

I have a repository too.

thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions