mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-07 13:34:55 +08:00
Ignore patches to content editable elements while focused (#247)
This commit is contained in:
parent
adb83eddc1
commit
d3a2bfb60b
1 changed files with 9 additions and 0 deletions
|
@ -32,6 +32,15 @@ const ContentEditable = {
|
|||
this.el.blur();
|
||||
}
|
||||
});
|
||||
|
||||
// While the element is focused, ignore the incoming changes
|
||||
this.el.addEventListener("focus", (event) => {
|
||||
this.el.setAttribute("phx-update", "ignore");
|
||||
});
|
||||
|
||||
this.el.addEventListener("blur", (event) => {
|
||||
this.el.removeAttribute("phx-update");
|
||||
});
|
||||
},
|
||||
|
||||
updated() {
|
||||
|
|
Loading…
Add table
Reference in a new issue