Merge pull request #8921 from remixer-dec/fix-callstack-loop

fix overriding getElementById on document
This commit is contained in:
AUTOMATIC1111 2023-03-25 17:41:42 +03:00 committed by GitHub
commit 91ae48fd7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
}