Closed kwevin closed 3 months ago
+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.
Are you recomposing?
It is using reactive to change the content when hovered over. But by commenting out the widgets in another screen the issue was resolved.
Are you using workers? Any threads?
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:
App
|
Main(Screen) <-- caused by some widget here
|
Popup(Screen) <-- issue happens here
By commenting out the widgets in my Main
screen the issue in the popup screen disappear. This also only started happening after upgrading to v0.63.0. I'll try to narrow down what is causing it, but so far recreating the situation under and MRE seems to not have work.
@willmcgugan - I seemed to have successfully created an MRE. The issue with the code attached is:
tab.dashboard_container.display = False
tab.loading_indicator.display = False
tab.progressbar.display = False
tab.additional_info.display = False
tab.line.display = False
It seems from v0.63.0
and onwards, this type of code is problematic.
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.https://github.com/Textualize/textual/assets/86712199/7a91a23c-0f1f-4ab8-ba06-7574c5516f09
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.
https://github.com/Textualize/textual/assets/86712199/13000885-d3aa-4378-87fb-0e2da23fb9e1
All the code can be found at https://github.com/kwevin/LISTEN.tui/tree/mre in the
mre
branch To run my repository, you would need libmpv to be in your PATH or env variable. Guide here.Thank you.