-
Notifications
You must be signed in to change notification settings - Fork 815
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
on_leave
event being fired by widget in inactive screen
#4630
Comments
+1 this issue affects me as well |
I'm going to need an MRE for this. If I can't reproduce it, I'm working blind. If you can reproduce it in your app, I would suggest removing things until it goes away. Check that whatever is under cursor isn't actually changing. Are you recomposing? That will cause a leave. Ditto if you setting the loading flag on a widget, that will cause a leave event because the loading indicator is now under the mouse. Are you using workers? Any threads? Basically, I need something to work with. |
I tried to recreate the issue with an MRE but i have no luck in doing so. Though I've narrowed down the issue to be a widget in an inactive screen I don't still know what cause the issues.
It is using reactive to change the content when hovered over. But by commenting out the widgets in another screen the issue was resolved.
No workers or threads are used to push the screen. There are normal worker and threaded worker running in the background. The screen stack I currently have looks like this:
By commenting out the widgets in my |
@willmcgugan - I seemed to have successfully created an MRE. The issue with the code attached is:
It seems from |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
Occurs in version v0.63 and v0.66
Textual Diagnostics
Versions
Python
Operating System
Terminal
Rich Console options
on_leave
event is being fired despite staying within the widget. This only started happening after updating to v0.63.0 from v0.62.0. I've attempted to narrow down the issue and found out that widgets or tasks from an inactive screen was causing the issue.example.mp4
Here is how the screen is pushed.
And by commenting out the widgets in tabbed content at main.py (the main screen) and pushing a test screen, the issue doesn't appear. if the test screen was pushed with all the tabbed content widget it would repeatedly fire _on_leave like in the example video.
Here is a demonstration of what I am talking about.
my_testing.mp4
All the code can be found at https://github.com/kwevin/LISTEN.tui/tree/mre in the
mre
branchTo run my repository, you would need libmpv to be in your PATH or env variable. Guide here.
Thank you.
The text was updated successfully, but these errors were encountered: