Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LiveDuo committed Oct 22, 2024
1 parent 87e01f4 commit 5115783
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/client/vanilla/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ function Editor({ standaloneServer = false }) {
const _components = getComponents()
if (_components.length === 0) {
canvasRef.current!.innerHTML = html
} else if (isElementTopHalf(hoveredComponent!, e)) {
} else if (hoveredComponent && isElementTopHalf(hoveredComponent!, e)) {
hoveredComponent!.insertAdjacentHTML('beforebegin', html)
} else if (!isElementTopHalf(hoveredComponent!, e)) {
} else if (hoveredComponent && !isElementTopHalf(hoveredComponent!, e)) {
hoveredComponent!.insertAdjacentHTML('afterend', html)
}

Expand Down

0 comments on commit 5115783

Please sign in to comment.