diff --git a/extras/playground/samples.js b/extras/playground/samples.js index 3a07cf12..c2eac2f3 100644 --- a/extras/playground/samples.js +++ b/extras/playground/samples.js @@ -490,11 +490,12 @@ class TodoItem extends owl.Component { async editTodo() { this.state.isEditing = true; - setTimeout(() => { - this.refs.input.value = ""; - this.refs.input.focus(); - this.refs.input.value = this.props.title; - }); + } + + focusInput() { + this.refs.input.value = ""; + this.refs.input.focus(); + this.refs.input.value = this.props.title; } handleKeyup(ev) { @@ -648,7 +649,7 @@ const TODO_APP_STORE_XML = ` - + `;