-
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
Mounting of Markdown
isn't reliably awaitable
#4455
Comments
I might be wrong but is the problem that the content of textual/src/textual/widgets/_markdown.py Lines 768 to 770 in da56de9
|
@TomJGooding is correct in where the issue lies. Changing that |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
I imagine this would be an issue for any container-like widget that itself returns awaitables of some description, but I first encountered this with
Markdown
and the attempt to populate aVerticalScroll
with them, awaiting amount_all
of them into theVerticalScroll
, and then attempting toscroll_end
.The effect of the problem can be seen with this code:
When run it should
await
themount_all
of a number ofMarkdown
into theVerticalScroll
and then perform ascroll_end
. The result is that it scrolls almost, but not quite, to the end:Delaying the
scroll_end
usingcall_next
,call_later
orcall_after_refresh
makes no difference. So far the only approach I've found to make this happen is to use aset_timer
to delay thescroll_end
, and the time required seems to be proportional to the number ofMarkdown
within theVerticalScroll
(on my Mac Mini, M2Pro, under normal load, anything less than a 0.9 second delay results in it not scrolling to the end; in the reasonable use case in the application I ran into this in I'm having to use a 0.05 second delay).textual diagnose output
Textual Diagnostics
Versions
Python
Operating System
Terminal
Rich Console options
The text was updated successfully, but these errors were encountered: