質問するログイン新規登録

回答編集履歴

2

調整

2020/06/02 16:51

投稿

yambejp
yambejp

スコア117973

answer CHANGED
@@ -15,6 +15,7 @@
15
15
  const config = { attributes: true, childList: true, characterData: true };
16
16
  document.querySelectorAll('[contenteditable]').forEach(x=>{
17
17
  observer.observe(x, config);
18
+ observer.observe(x.firstChild, config);
18
19
  [...x.childNodes].forEach(y=>{
19
20
  observer.observe(y, config);
20
21
  });

1

調整

2020/06/02 16:51

投稿

yambejp
yambejp

スコア117973

answer CHANGED
@@ -14,7 +14,10 @@
14
14
  });
15
15
  const config = { attributes: true, childList: true, characterData: true };
16
16
  document.querySelectorAll('[contenteditable]').forEach(x=>{
17
- observer.observe(x.firstChild, config);
17
+ observer.observe(x, config);
18
+ [...x.childNodes].forEach(y=>{
19
+ observer.observe(y, config);
20
+ });
18
21
  });
19
22
  });
20
23
  </script>