Skip to content

[NcActions] Proposal: submenu support #6066

@ShGKme

Description

@ShGKme

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-menu buttons 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?

Metadata

Metadata

Assignees

Labels

feature: actionsRelated to the actions components

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions