Skip to content

Strange behavior when setting two events #569

@greenersharp

Description

@greenersharp

I have some simple code that lets me edit an html element by setting contenteditable to 'true' wehn I doubleclick it.
Then, when I'm done editing the text, I can hit the Enter key which will "save" the new text (by stopping the event and setting contenteditable to 'false'

<h5 _="on dblclick set @contenteditable to 'true'" _="on keydown[key is 'Enter'] halt the event then set @contenteditable to 'false'">Change me </h5>

But it's not working for some reason. And even stranger, if you reverse the order of the events, the behaviour changes:

<h5 _="on keydown[key is 'Enter'] halt the event then set @contenteditable to 'false'" _="on dblclick set @contenteditable to 'true'">Change me </h5>

And no errors to help debug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions