Skip to content

Commit

Permalink
v0.1.1: put editor.focus in setTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
rnons committed Feb 24, 2020
1 parent 168bda3 commit 38c8ceb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@hunchcloud/live-element",
"version": "0.1.0",
"version": "0.1.1",
"description": "A playground for live editing custom elements",
"main": "dist/index.js",
"main": "dist/live-element.js",
"files": [
"dist"
],
Expand Down
4 changes: 3 additions & 1 deletion src/live-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class LiveElement extends HTMLElement {
onChange = () => {
if (this.editor) {
this.innerHTML = this.editor.value;
this.editor.focus();
setTimeout(() => {
this.editor?.focus();
});
}
};
}
Expand Down

0 comments on commit 38c8ceb

Please sign in to comment.