-
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
Feature/#2292 allow menu to be expanded by default #2508
Feature/#2292 allow menu to be expanded by default #2508
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to add the property to viselements.json.
And tests are never too much :-)
Thank you for your feedback, I will make sure to adjust my contribution accordingly. |
Miguel lehmann
…be-expanded-by-default
I adjusted my contribution according to your feedbback, also ading the unit test "starts folded unless 'expanded' is true" to Menu.spec.tsx, which covers the added feature. |
Reverted package-lock.json file changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work
we need to find a way to not have the package-lock.json files in the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you find a way to remove the package-lock.json files from the PR ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only way I found was to redo the changes in a different branch, this time not pushing these unnecessary files. Now, I could either replace the contents of this fork with those of the new branch (as far as I can tell this would be a permanent override) or open a new PR based on the new branch. Which one would you prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new PR is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new PR is called "Feature/#2292 allow menu to be expanded by default (Redo)"
package-lock.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file shouldn't exist
Will do |
What type of PR is this?
Description
I added the "expanded" parameter to the Menu component. It is a boolean that, when set to true, causes the menu to start off expanded.
Default value is false, which starts the menu folded.
Related Tickets & Documents
Feature description
Running this code will generate a folded menu:
from taipy.gui import Gui
import taipy.gui.builder as tgb
options = [("a", "Option A"), ("b", "Option B"), ("c", "Option C"), ("d", "Option D")]
with tgb.Page() as page:
tgb.menu(label = "options",
lov = options,
)
if name == "main":
Gui(page).run(title="Menu - Selected")
By setting the "extended" property to "True", the menu will start expanded:
[...]
with tgb.Page() as page:
tgb.menu(label = "options",
lov = options,
expanded = True,
)
[...]
Checklist