fix(ContextMenu): adjust anchor element selector to execute action on Enter key when the "item" template has been redefined
fixes #5983.
The selector for the anchor element of the Enter key event is not the same on the ContextMenu and TieredMenu components :
- TieredMenu :
[data-pc-section="action"] - ContextMenu :
a[data-pc-section="action"]
The problem with the ContextMenu selector is that the Enter key does nothing once the item template has been redefined :
<ContextMenu :model="items">
<template #item="{ item, props }">
<div v-bind="{ ...props.action, ...item.attributes }">
<span>{{ item.label }}</span>
</div>
</template>
</ContextMenu>
There's no such problem with the TieredMenu component.
This PR changes the selector to use the same one as the TieredMenu component.
I don't know in which version this fix should be made (3? 4?), I'll let you decide the target branch.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| primevue | ⬜️ Ignored (Inspect) | Visit Preview | Jul 29, 2024 8:08pm | |
| primevue-v3 | ⬜️ Ignored (Inspect) | Visit Preview | Jul 29, 2024 8:08pm |
Please create an issue for the PR.
You could also port the PR for v4. Main version is v4.
Thank you!
My bad! Here's the issue : #5983
Since I've upgraded to v4, I've changed the target branch to "master".