-
Notifications
You must be signed in to change notification settings - Fork 814
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
Inconsistent events when revealing a widget #2582
Comments
davep
added a commit
to davep/textual
that referenced
this issue
May 16, 2023
While the fix for Textualize#2557 likely isn't *the* fix (see Textualize#2582 for some context around that), it is a fix that works for now. As such, with the change, there was a double attempt to refresh the content tracking in the clearing of options in the OptionList, which shouldn't be necessary. This removes that.
There have been some related fixes since this issue. It may be working as expected now. |
Grabbing to recheck the above code. |
Tested with Closing as fixed by recent changes. |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is related to #2557 in that it's something noticed while trying to get to the core of what was going on in that issue. The code that follows is a little convoluted, but it's done in a way to try and mimic how
Select
works. While possibly not the root of the issue, the idea here is that a widget is shown/hidden by having the classes of its container manipulated (this is howSelect
works). It might be that this aspect of the issue can be eliminated.Also note that this isn't being recorded for a deep dive right now, this is more a case of recording a set of symptoms and some code for reproducing them, and then it can be looked at later.
So, the code:
This will give a display with two buttons and a
TextLog
. If either button is pressed I think you'd expect to see anon_show
event for the related just-shown widget.On first startup, if you press the button to show a label, the
Label
widget gets anon_show
andon_resize
event. Every toggle after that also gets the same pair of events (hiding it never gets aon_hide
, see #2574).Again, on first startup, if you press the button to show a list, the
OptionList
widget gets anon_resize
event, but surprisingly noon_show
. Every toggle after that gets anon_show
andon_resize
pair of events (again, noon_hide
for the reasons mentioned above).I've not dived deeper into this than to document the above (and to test similar issues within
Select
itself). The only observation I've got right now is thatLabel
inherits fromStatic
, which inherits fromWidget
.OptionList
on the other hand goes viaScrollView
, which does have a bit of code pertaining to sizes. I don't know that this is relevant here but it does seem to be the one obvious difference between the two sets of results.The text was updated successfully, but these errors were encountered: