-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Have part or dialog centered to the element clicked #2293
Comments
it'a dialog then |
This relates slightly to another issue: #2252. By the way, a contributor has proposed to help with it. |
@FredLL-Avaiga That works for me. What do you mean by dynamically? |
I mean that you can change the id to which the dialog is related. |
Ok, I agree that the id should be dynamic. Now, I don't understand the part about the selector 😆 |
The id is a string that allows to locate a component on a page and position a dialog based on it. |
Got it, thanks! |
from from taipy.gui import Gui, State
ref_id = None
pop_open = False
val = None
def on_action(state: State, id: str):
if id == "dialog":
state.ref_id = None
state.pop_open = False
elif id:
state.ref_id = f"#{id}"
state.pop_open = True
else:
state.val = state.val +1 if state.val is not None else 1
page = """
<|button 1 |button|id=id1|>
<|button 2|button|id=id2|>
<|button |button|id=id3|>
<|button |button|id=id4|>
<|button |button|id=id5|>
<|button |button|id=id6|>
<|button |button|id=id7|>
<|button |button|id=id8|>
<|button |button|id=id9|>
<|button |button|id=id10|>
<|button |button|id=id11|>
<|{pop_open}|dialog|popup|ref_id={ref_id}|id=dialog|
<|inside the popup|button|>
<|{val}|>
|>
"""
if __name__ == "__main__":
Gui(page).run(title="2293 popup") |
resolves #2293 - also fix a possible bug in chart
any remark @FlorianJacta ? |
Do you have any screenshot? @FredLL-Avaiga What do you need |
better than a screen shot |
What happens if you don't have your |
yes, |
The default behavior for the width is to fit the content? |
* popupdialog associated with an id (query selector) resolves #2293 - also fix a possible bug in chart * with test --------- Co-authored-by: Fred Lefévère-Laoide <[email protected]>
Description
Here, I have clicked on an icon and I have a dropdown menu of labels next to where I clicked:
Here, I have clicked on icon and I see a dialog/part showing up next to where I clicked:
I want to do that generically to put anything in this part. If I click somewhere else, this dialog should disappear.
Acceptance Criteria
Code of Conduct
The text was updated successfully, but these errors were encountered: