Markdown isn't showing/rendering after cleaning the page
See original GitHub issueDescription
My app contains multiple logical pages (I am cleaning the page and adding the needed objects for the needed page).
I am using Markdown to render some texts within one of these pages (help page). I saw that when I run the page containing the markdown object, it renders correctly, but if I go to another page within the same app, and go back to the page containing the Markdown, it shows nothing.
Code example to reproduce the issue:
def help_page(e):
page.clean()
add_basic_buttons(page) ### Func to add the basic buttons above
help_msg = """
## About...
- aa
- bb
- cc
"""
page. Add(
Markdown(
value=help_msg,
selectable=True,
extension_set="commonMark",
on_tap_link=lambda e: page.launch_url(e.data),
expand=True,
)
)
Describe the results you received: As said, first click on ‘Help page’ it shows the below rendered:
If I go to another page, and then come back to ‘Help page’, it doesn’t show the Markdown
Describe the results you expected:
I expect every time to render the Markdown and show the result.
Flet version (pip show flet
):
Name: flet
Version: 0.1.52
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page:
Author:
Author-email: Appveyor Systems Inc. hello@flet.dev
License: MIT
Requires: beartype, repath, websocket-client
Required-by:
Operating system:
macOS
Additional environment details: NA
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
Not exactly. Before 0.1.60 Markdown control was always wrapped into “ListView” hence the requirement to make it “expand”. In 0.1.60 Markdown is no longer wrapped into ListView, so to make it scrollable you have to wrap it into ListView or put on a page with scrolling enabled. This is the issue: https://github.com/flet-dev/flet/issues/359#issuecomment-1252835569
I updated Markdown examples: A single Markdown control on a scrollable page: https://github.com/flet-dev/examples/blob/main/python/controls/markdown/markdown-test.py Multiple Markdown controls in ListViews: https://github.com/flet-dev/examples/blob/main/python/controls/markdown/markdown-listviews.py
omg, so scrolling has been resolved on flet==0.1.60 by removing
page.scroll
from the code