-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat(ktreelist): add collapse/expand option [KHCP-14716] #2583
feat(ktreelist): add collapse/expand option [KHCP-14716] #2583
Conversation
✅ Deploy Preview for kongponents-sandbox ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for kongponents ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
31e0e4a
to
9249d08
Compare
v-if="hasIcon" | ||
class="tree-item-icon" | ||
data-testid="tree-item-icon" | ||
<ChevronDownIcon |
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 few issues:
- The chevron should point "down" when expanded, and "right" when collapsed.
- Clicking the button seems to toggle the icon direction.
- I can tab to the icon to collapse/expand but dont have a way to actually trigger it
- After reordering the items, but not touching collapse icon button, the icon direction seems to change on the docs site.
- After reordering, I can no longer expand/collapse the items on the first click consistently. Sometimes it takes several clicks.
// set previous icon state after DOM was re-rendered | ||
await nextTick(() => { | ||
treeItems.value?.forEach((item: typeof KTreeItem) => { | ||
item?.setExpandedValue(childrenVisibilityMap.value.get(item?.id)) | ||
}) | ||
}) |
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.
nit: can we update the syntax here to match the other usage in the repo?
// set previous icon state after DOM was re-rendered | |
await nextTick(() => { | |
treeItems.value?.forEach((item: typeof KTreeItem) => { | |
item?.setExpandedValue(childrenVisibilityMap.value.get(item?.id)) | |
}) | |
}) | |
// set previous icon state after DOM was re-rendered | |
await nextTick() | |
treeItems.value?.forEach((item: typeof KTreeItem) => { | |
item?.setExpandedValue(childrenVisibilityMap.value.get(item?.id)) | |
}) |
await nextTick(() => { | ||
if (props.collapsible) { | ||
triggerCollapse() | ||
} | ||
}) |
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.
ah can we update the syntax here as well?
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.
lgtm
# [9.18.0](v9.17.5...v9.18.0) (2025-01-22) ### Features * **ktreelist:** add collapse/expand option [KHCP-14716] ([#2583](#2583)) ([a5490a3](a5490a3))
🎉 This PR is included in version 9.18.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
https://konghq.atlassian.net/browse/KHCP-14716
collapsible
prop to enable collapse/expand feature.collapseAll
prop to allow initial collapse/expand for all items.