-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event example does not work #241
Comments
Recently fixed an issue (#232) where a browser extension was modifying the dom, seems like this could be similar. Once we can replicate the cause it should be possible to fix. @ranok can you confirm which browser you are seeing this in, and with which extensions? If you have a lot of extensions installed, maybe try disabling some too see if you can figure out which is causing it. You can also check the dom inspector in devtools to see if anything looks off (and post a screenshot here if so) |
I'll try it in safemode and slowly add them back in shortly |
Good catch, Adblock for Youtube oddly gets permissions for all sites and was somehow causing issues, by restricting it to only Youtube the example works again. |
Thank you for confirming @ranok. I imagine the extension requests all pages so that it can also block ads on embedded youtube videos. I would still like to fix this as it may impact other users. I can't replicate it by installing the extension, can you share what change it made to the browser dom? |
Here are the two If I make another
|
Thank you @ranok. Could you re-open the issue too? Here's a minimal reproduction: import std/dom
include pkg/karax/prelude
var lines: seq[kstring] = @[]
proc createDom(): VNode =
result = buildHtml(tdiv):
button:
text "Say hello!"
proc onclick(ev: Event; n: VNode) =
lines.add "Hello simulated universe"
for x in lines:
tdiv:
text x
var modified = false
proc postrender =
if modified: return
modified = true
document.getElementById("ROOT").appendChild(document.createElement("div"))
setRenderer(createDom, clientpostrenderCallback=postrender) The error is triggered by this line. Compiling the example above with I'm not sure of the best approach to fix here. Developers may have browser extensions that do dom modifications (as we saw also in issue #232) so I don't think these checks should be run by default. Perhaps they could be opt in with a |
Sounds good to me. At least I cannot think of a better solution. |
Using the button.nim example from the README results in the same uncaught AssertionDefect as #86 and #123.
Below is an image of the DevTools console output when I click the button (I renamed the file to albiero, but otherwise it's a direct copy/paste from the examples.:
![image](https://user-images.githubusercontent.com/66790/221390106-9342e412-c7b3-4609-a678-ca718c49c89d.png)
This is with karax 1.2.2 and nim 1.6.10.
The text was updated successfully, but these errors were encountered: