innerHTmL problems. Not synchronous?

This commit is contained in:
2026-04-15 23:08:45 +02:00
parent e19afc324a
commit b7c0ea2c1c
2 changed files with 3 additions and 3 deletions

View File

@@ -745,8 +745,8 @@
(if (string? html) (if (string? html)
(let ((r (webview-call-js wv (let ((r (webview-call-js wv
(with-id id el (with-id id el
("el.innerHTML = '~a'; ("el.innerHTML = '~a';window.setTimeout(function (){ }, 0); return true;"
await new Promise(resolve => setTimeout(resolve, 0)); return true;" (esc-quote html)))))) (esc-quote html))))))
(if r 'oke 'failed)) (if r 'oke 'failed))
(webview-set-innerHTML! wv id (xexpr->string html)) (webview-set-innerHTML! wv id (xexpr->string html))
) )

View File

@@ -97,7 +97,7 @@
" let a = (el === null) ? -1 : el.getAttribute('type');\n" " let a = (el === null) ? -1 : el.getAttribute('type');\n"
" if (a == -1) {\n" " if (a == -1) {\n"
" return a;\n" " return a;\n"
" else { \n" " } else { \n"
" if (a === null) {\n" " if (a === null) {\n"
" return false;\n" " return false;\n"
" } else {\n" " } else {\n"