Replies: 1 comment
-
I've tried using PassThrough (PT) API to solve this programmatically. Here's what I found:
const ptPanelMenu = computed<PanelMenuPassThroughOptions>(() => ({
root(options) {
const { props, instance } = options
instance.changeActiveItem({}, targetItem) // Only works for first level
}
}))
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello PrimeVue team,
I'm experiencing some challenges with the PanelMenu component. While these aren't strictly bugs, they make it difficult to implement what should be simple functionality.
Let me first explain what I'm trying to achieve without using expandedKeys:
How can we programmatically expand specific menu levels? For example, I want to expand a path like 1_2_3 (representing the menu hierarchy)
How can we persist this expansion state?
Now, here's the interesting part - while using expandedKeys does solve these initial problems, it creates another significant issue: When I use expandedKeys, it breaks the single-expand functionality (multiple: false). In other words, the accordion-style behavior that multiple: false should provide stops working entirely.
This leaves me in a position where I need to write complex custom logic to achieve what should be basic functionality, which feels like it's defeating the purpose of using a component library.
I really hope the team can look into this and consider improving these aspects of the PanelMenu component.
Thank you for your attention to this matter. 🙏
Beta Was this translation helpful? Give feedback.
All reactions