mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-19 07:26:50 +00:00
Add parent checking before inserting or removing the child
This commit is contained in:
@@ -111,7 +111,9 @@ export default function CustomContextMenu(props) {
|
||||
document.body.appendChild(tempInput);
|
||||
tempInput.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(tempInput);
|
||||
if (tempInput && tempInput.parentNode && tempInput.parentNode.contains(tempInput)) {
|
||||
tempInput.parentNode.removeChild(tempInput);
|
||||
}
|
||||
// alert("Text copied: " + selectedText);
|
||||
} else {
|
||||
// alert("Please select some text first.");
|
||||
|
||||
Reference in New Issue
Block a user