nextcloud-libraries / nextcloud-libraries/nextcloud-vue
[NcActions] Proposal: submenu support
Open
@ShGKme is already working on this.
Since Sep 9, 2024.
feature: actions
- Dominant language
- Vue
- Stars
- 246
- Forks
- 99
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 103
Description
Currently sub menus are implemented almost manually via:
<template v-if><NcActionButton is-menu>
It works, but:
- Not great in a11y, including lack of attributes and focus movement
- Not very semantic for developers
- Requires manual implementing of menu/submenu state, the back button
Proposal: allow to use slots for additional menus like
<NcActions>
<template #default>
<NcActionButton menu="foo">
Sub-menu foo
</NcActionButton>
</template>
<template #menu-foo>
<!-- Content -->
</template>
</NcActions>
So that:
- Formal
is-menubuttons actually switch to another slot (just renders other buttons) - We have a better separation between sub-menus
- We can implement it internally with a11y
The only thing I don't like here, is that we still have to check for the default slot for inline buttons...
What do you think?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.