Skip to content

Commit

Permalink
add hotfix to avoid tooltip buildup in chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 committed Oct 7, 2024
1 parent 90cca98 commit c04775a
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 c04775a

Please sign in to comment.