Skip to content

Commit

Permalink
fix: #395 尝试无脑修复,需要humyfred确认
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu authored and humyfred committed Apr 10, 2023
1 parent 2aba33b commit 1f30506
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/hooks/Suggester.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ class SuggesterPanel {
this.cursorMove = true;
this.suggesterConfig = {};

if (!this.$suggesterPanel && isBrowser()) {
document.body.appendChild(this.createDom(SuggesterPanel.panelWrap));
this.$suggesterPanel = document.querySelector('.cherry-suggester-panel');
if (!this.$suggesterPanel && isBrowser() && document) {
document?.body?.appendChild(this.createDom(SuggesterPanel.panelWrap));
this.$suggesterPanel = document?.querySelector('.cherry-suggester-panel');
}
}

Expand Down Expand Up @@ -255,7 +255,7 @@ class SuggesterPanel {
}

showsuggesterPanel({ left, top, items }) {
if (!this.$suggesterPanel) {
if (!this.$suggesterPanel && isBrowser()) {
document.body.appendChild(this.createDom(SuggesterPanel.panelWrap));
this.$suggesterPanel = document.querySelector('.cherry-suggester-panel');
}
Expand Down

0 comments on commit 1f30506

Please sign in to comment.