Skip to content
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

Markdown isn't showing/rendering after cleaning the page #407

Closed
mkhachfeh opened this issue Sep 28, 2022 · 6 comments
Closed

Markdown isn't showing/rendering after cleaning the page #407

mkhachfeh opened this issue Sep 28, 2022 · 6 comments

Comments

@mkhachfeh
Copy link

Description

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:
Screenshot 2022-09-28 at 14 59 14

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. [email protected]
License: MIT
Requires: beartype, repath, websocket-client
Required-by:

Operating system:

macOS

Additional environment details:
NA

@FeodorFitsner
Copy link
Contributor

Thanks for starting an issue with providing the details!

  1. Could you please upgrade to the latest Flet 0.1.60?
  2. if I go to another page within the same app, and go back to the page containing the Markdown - provided code is not enough to see how do you navigate between pages. Could you please provide more complete repro?

@mkhachfeh
Copy link
Author

mkhachfeh commented Sep 29, 2022

Hi Feodor,

Thanks for the quick response.

Seems that upgrading to 0.1.60 made the trick, and MD is working as needed.

Appreciate your work

@mkhachfeh
Copy link
Author

hmm but now tested again for your example mentioned here:
https://flet.dev/docs/controls/markdown

And seems the scrolling isn't working anymore

@mkhachfeh
Copy link
Author

@FeodorFitsner
So the conclusion:

  • on flet==0.1.52: my app isn't refreshing after going to another page but working and scrolling at the first time + your example is working and scrolling
  • on flet==0.1.60: my app is refreshing after going to another page but not scrolling + your example is working but not scrolling at all

@mkhachfeh
Copy link
Author

omg, so scrolling has been resolved on flet==0.1.60 by removing page.scroll from the code

@FeodorFitsner
Copy link
Contributor

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: #359 (comment)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants