Skip to content

Commit

Permalink
[Bug]: Fix playground autoComplete visual problem (#893)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 authored Oct 25, 2024
1 parent c8168c6 commit 80e9f50
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Resources/views/Feature/explorer.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,27 @@
GraphQLPlayground.init(root, config);
});
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (mutation.removedNodes.length) {
mutation.removedNodes.forEach((node) => {
if (
node.tagName === "UL" &&
node.classList.contains("CodeMirror-hints")
) {
if (!node.parentElement && mutation.target.parentElement) {
mutation.target.parentElement.removeChild(mutation.target);
}
}
});
}
});
});
observer.observe(document.body, {
subtree: true,
childList: true,
});
</script>
</body>
Expand Down

0 comments on commit 80e9f50

Please sign in to comment.