-
Notifications
You must be signed in to change notification settings - Fork 317
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
Hover state doesn't update if there are no mouse move events #220
Comments
Right, yes, this also happens with animations if the hovered element moves away from the mouse cursor. Another case is when the element under the cursor is removed, and new ones are constructed. I've noticed this may break scrolling until after the mouse has moved again, probably because we need to re-establish a new hover element. This is noticeable sometimes in the debugger. I'd like to know more about your issue with your key mapping screen and how that is affected, could you add some more details? I'm concerned the proposed fix may cause some unexpected behavior, in particular for users not using mouse cursors or intentionally not providing any mouse input. Hm, actually, now after looking over the code, I see that we don't send a mouse move event if the position is the same, so this might be a viable approach. Although we do send out drag events, not sure if this is an issue. In any case we should think some more about possible ways this might cause issues before we push these changes. |
Oh, I meant that as a user side fix.
I have a list of buttons corresponding to actions that can be mapped. To map an action you click the button for that action and the page starts waiting for an input (key press or mouse button press). I don't want the input to do whatever action it would normally do so I use "pointer-events: none" to block them while waiting for input. This works fine unless the user doesn't move the mouse and then presses the left mouse button. In this case it still registers the click on the button despite "pointer-events: none" and starts waiting for input again. |
Ah, I see. It could be a place to start in any case. Thanks for your very descriptive example. One idea I have for a solution is to do something equivalent to Any thoughts or other ideas? |
Sounds good to me. |
How about this issue's progress? |
Yeah, it is planned for RmlUi 5.0, I'll try to prioritize this in the near feature. I won't backport any new features, if you really need it in 4.x you will have to port the changes yourself. There aren't really any significant breaking changes (at least yet), so you might want to consider using the RmlUi master branch for your project. |
Thanks for your reply. |
…eLeave()' to remove hover states and prevent them from updating, see #220.
Hey. I've made an effort at implementing this now.
Seems to work well for me for now, however it does require more testing in case of unintended consequences. Let me know how it goes, cheers! |
I test it on Windows 10,it works (use opengl2 as default). |
Reproducing:
Result: The box will remain highlighted even when the cursor is no longer over the box.
It can cause some less innocuous bugs too; I encountered it while trying to temporarily block input in a key mapping screen.
A simple fix is to make sure to call ProcessMouseMove before every update (the arguments can be the same as last update).
The text was updated successfully, but these errors were encountered: