[Feature] Can I delay Link to href until on_click event render is complete?
I am trying to implement the following feature:
Scenario
- click the Link component in Drawer component.
- then, Drawer component will be closed and screen will be moved to the permalink in main page. but, if components (AccordionItems) on main page are collapsed, It must be unfolded before move.
Currently It is processed as procedure:
- Link to href.
- close Drawer component
- unfold components in main page.
Result So this brings us to the screen pointing to the hidden element before expanding the component.
Feature Request
-
Can I delay Link to href until on_click event render is complete?
-
~~Can I control page in event handler of pc.State in order to redirect a link in Python?~~
β‘οΈ I found it https://pynecone.io/docs/events-reference/server-sideπ Updated on 2023-01-29 03:31:48 β οΈ [Bug] When I use this way, "return pc.redirect()" causes that other click events are no longer available after redirect. (the redirect works well.) (not working. no response) Specifics (please complete the following information):
-
Python Version: 3.11.0
-
Pynecone Version: pynecone-io = "0.1.13"
-
OS: WSL Ubuntu 22.04 distribution in Windows 11 Version 21H2 (OS Build 22000. 1455)
-
Browser (Optional): Edge Browser
-
Shell: Fish shell
-
Node Version: 18.12.1
You may be able to use pc.redirect see here for details https://pynecone.io/docs/events-reference/server-side. Once the variable to trigger the drawer is changed you could return pc.redirect with a specific href
You may be able to use pc.redirect see here for details https://pynecone.io/docs/events-reference/server-side. Once the variable to trigger the drawer is changed you could return pc.redirect with a specific href
When I use this way, "return pc.redirect()" causes that other click events are no longer available after pc.redirect(). (the redirect works well.)
- my component that triggers on_click event handler:
return pc.tooltip(
pc.button(
pc.icon(tag="InfoOutlineIcon"),
bg="whitesmoke",
on_click=lambda x: WordDataState.move_to_permalink(index),
),
label="Move to body section",
),
- href of redirect is id of a AccordionButton.
- Other all click events of AccordionItems are not working (no response).