square / maker

Maker Design System by Square

Home Page:https://square.github.io/maker/styleguide/latest-stable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support to close the `popover` from a `Menu` instance

kchung opened this issue · comments

Feature request

Add support to close the popover from a Menu instance

Why?

Right now, to force the Menu to close, you have to do something like:

<template>
  <m-menu ref="menu">
    <!-- ... -->
  </m-menu>
</template>
this.$refs.menu.$refs.popover.close();

This could be fragile since we're reaching into the component's internal references to close. It would be nice to expose a public method that does this:

this.$refs.menu.close();

Alternatives

No response

Additional context

No response