Skip to content
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

fix(ContextMenu): adjust anchor element selector to execute action on Enter key when the "item" template has been redefined #5944

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

clemvnt
Copy link
Contributor

@clemvnt clemvnt commented Jun 21, 2024

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.

Copy link

vercel bot commented Jun 21, 2024

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

@clemvnt clemvnt changed the title Fixed execution of a context menu action on the Enter key when the "item" template has been redefined fix(ContextMenu): Adjust anchor element selector to execute action on the Enter key when the "item" template has been redefined Jun 21, 2024
@clemvnt clemvnt changed the title fix(ContextMenu): Adjust anchor element selector to execute action on the Enter key when the "item" template has been redefined fix(ContextMenu): adjust anchor element selector to execute action on the Enter key when the "item" template has been redefined Jun 21, 2024
@clemvnt clemvnt changed the title fix(ContextMenu): adjust anchor element selector to execute action on the Enter key when the "item" template has been redefined fix(ContextMenu): adjust anchor element selector to execute action on Enter key when the "item" template has been redefined Jun 21, 2024
@tugcekucukoglu
Copy link
Member

Please create an issue for the PR.

You could also port the PR for v4. Main version is v4.

Thank you!

@tugcekucukoglu tugcekucukoglu added the Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated. label Jun 27, 2024
@clemvnt
Copy link
Contributor Author

clemvnt commented Jun 27, 2024

My bad! Here's the issue : #5983

@clemvnt clemvnt changed the base branch from v3 to master July 29, 2024 20:07
@clemvnt
Copy link
Contributor Author

clemvnt commented Jul 29, 2024

Since I've upgraded to v4, I've changed the target branch to "master".

@tugcekucukoglu tugcekucukoglu merged commit 706e623 into primefaces:master Aug 1, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ContextMenu: The item action is not executed on Enter key when the "item" template has been redefined
2 participants