JSFiddle - React, Tailwind, and code Playground

by dglazkov

HTML

<input>

JavaScript

function log(msg)
{
    if (!window.logDiv)
       window.logDiv = document.body.appendChild(document.createElement("div"));
    window.logDiv.appendChild(document.createElement("div")).textContent = msg;
}

function checkForLeaks(evt)
{
    if (evt.relatedTarget && !evt.relatedTarget.parentNode)
        log('Shadow DOM leaked!');
}

function runTest()
{
    window.addEventListener("mouseover", checkForLeaks, false);
    window.addEventListener("mouseout", checkForLeaks, false);
    
}

window.onload = runTest;