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.
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.