fix overriding getElementById on document

This commit is contained in:
Remixer Dec 2023-03-25 18:23:34 +04:00
parent b2c428a095
commit 22bfcf135f

View file

@ -2,7 +2,7 @@ function gradioApp() {
const elems = document.getElementsByTagName('gradio-app')
const elem = elems.length == 0 ? document : elems[0]
elem.getElementById = function(id){ return document.getElementById(id) }
if (elem !== document) elem.getElementById = function(id){ return document.getElementById(id) }
return elem.shadowRoot ? elem.shadowRoot : elem
}