-
Notifications
You must be signed in to change notification settings - Fork 326
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
Cannot type in any HTML text field (filtering in full-screen visualization or renaming project in dashboard) #6828
Comments
This is in the viz pop up as well as the full screen one. |
Probably related to recent event handling (but not prevent-default). |
@farmaazon I believe this is cause by prevent default, why do you think otherwise? CC @vitvakatu, as you'd probably know that best, as you've been changing prevent-default behavior recently. |
Thinking twice, I think I was mistaken. |
The same cause seems to prevent us from renaming project name in the new dashboard. Should be checked as part of this task as well (https://discord.com/channels/401396655599124480/1113051687838560347/1113428099288277033)
|
well... it breaks all dashboard inputs which is kinda bad:
|
If it's related, then it's even higher priority right now, as it breaks a lot of things. @vitvakatu do I remember correctly you've been handling the prevent defaults code recently? If so, can you look at it, please? CC @sylwiabr |
i think the simplest fix would be to bind all event listeners on the relevant code is here (not that it's useful for this issue): enso/lib/rust/frp/src/io/keyboard.rs Lines 440 to 457 in 343b5fb
it's also worth noting that this is almost certainly due to leaked objects, which #6911 may fix |
Handling of mouse events is more complex. On the Rust side we are listening to some events on window and on some events just on the WebGL canvas element. For example, we are listening for mouse move globally, but for mouse clicks, we are listening only on the canvas element. This allows us to get events correctly, when for example there is a DOM element above the canvas (then we don't want to handle the clicks, but we want to be able to handle mouse up for dropping things). However, I don't see how this issue might be connected to either the decision on what element we are listening for the events nor how it could be connected to memory leaks on scene drop. |
what element we are listening for the events: if we don't listen on how it could be connected to memory leaks: ideally wasm drop should free the keyboard event listeners on |
oh, but of course that wouldn't be a solution for events inside the ide itself (e.g. visualizations) |
Wait, but the dashboard listens for events somehow, right? This is not connected to how we listen for events in Rust? Regarding drop, it should work even with memory leaks. Look, we designed it this way not to "steal" events from other elements. For example, if you open performance window on top of Enso Graph, you can click there, and the events are passed correctly there. The same should be true for keyboard events. Enso should not steal events from DOM elements above it, so even with memory leaks, this should work fine. |
yeah - but the issue is that dashboard UI elements don't process the events because they're being as for not stealing events, that makes sense i guess the ideal fix would be to only an alternative solution might be to only listen to events on the canvas element on which the IDE is rendering, and check that so this might be a lot more difficult than it initially seems |
oh yeah re: dashboard listens for events somehow i think it doesn't really listen to most keyboard events, the inputs not working are browser default behavior which is being |
I believe the solution is simpler than it seems. Why we are using preventDefault in the first place? It's an ugly beast and we should not use it if we don't have to! We use it to block some browser shortcuts like ctrl+r, that's it! Right now, we are doing prevent default on every keystroke if Im correct. Instead, we can do it on just predefined set of shortcuts, and everything should work fine. @vitvakatu, please confirm if Im right. |
Please note @wdanilo that this task is already scheduled for this iteration. It's assigned to me, and I will do it right after finishing the current task (that means today). Let's not make a confusion in the current work. |
Seems to be correct. Right now we prevent default for all keyboard events (keyup and keydown), but we can do that only for certain shortcuts (like @somebody1234's suggestion about attaching keyboard events listeners to |
I'm extremely sorry for the confusion! Thanks Adam for pointing it out! |
To reproduce:
It can be reproduced on bd70ed6
The text was updated successfully, but these errors were encountered: