Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Can't follow the route #1309

Closed
antonnurapkin opened this issue Apr 19, 2023 · 6 comments
Closed

Can't follow the route #1309

antonnurapkin opened this issue Apr 19, 2023 · 6 comments

Comments

@antonnurapkin
Copy link

After authorization I want to go to home page, but it doesnt happen, I again get to the authorization page.

def view(page:Page):

def login(e):
    e.page.launch_url(page.url+'/home')

view = View('',controls=[TextButton('Login',
                                        on_click=login
                                        )])

return view
@antonnurapkin
Copy link
Author

Also tried this

def login(e):
webbrowser.open_new_tab(page.url+'/home')

@gbrandt
Copy link

gbrandt commented Apr 19, 2023

The proper way is to call page.go( route ) and then to handle the change in page on the on_route() handler. See here: https://flet.dev/docs/guides/python/navigation-and-routing

@antonnurapkin
Copy link
Author

@gbrandt
I want to create a new browser tab so that I have two tabs: a page with the old route and a page with the new one.
In your method it follows the route in current tab(page)

@gbrandt
Copy link

gbrandt commented Apr 19, 2023

Ahh, my misunderstanding. On Safari, it is currently impossible to open a new tab, you will briefly see 'pop-up blocked' in the window if you try. On MacOS launch_url( url, "_self") will replace the current tab, on others launch_url( url, "_blank") will open a new tab. See #1105 for more info.

@FeodorFitsner
Copy link
Contributor

@antonnurapkin if it's Safari and popup-blocker then I suggest to close this issue in favour of #1105?

@antonnurapkin
Copy link
Author

antonnurapkin commented Apr 22, 2023

@FeodorFitsner to my mind it's not the same issue
I want to use the route as a URL and follow it while displaying a new page on a new tab of my browser(Yandex) .

Is it real?

@flet-dev flet-dev locked and limited conversation to collaborators Sep 13, 2023
@FeodorFitsner FeodorFitsner converted this issue into discussion #1832 Sep 13, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants