How to have an Input box in an md-menu item

Viewed 3237

I want to have an option to add an item to existing list or create a new one; similar to youtube's 'Add to playlist'. The following kind of works but the menu goes away once there is focus on the input box. Is there a way to disable closing of menu on click of one item in the menu?

Environment is Angular 2 / material 2.

    <button md-raised-button  [mdMenuTriggerFor]="menu">Add To</button>
    <md-menu #menu="mdMenu">
      <button md-menu-item>Item 1</button>
      <button md-menu-item>Item 2</button>
      <md-input-container class="mx-4">
        <input mdInput placeholder="Create new" value="">
      </md-input-container>
    </md-menu>
1 Answers
Related