components icon indicating copy to clipboard operation
components copied to clipboard

The keybord events of DOWN_ARROW and UP_ARROW is not working.

Open eric-heihei opened this issue 10 years ago • 2 comments

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When i click an button, a menu show under the button.After I make the focus to the menu item, i press keyboard 'down_arrow' or 'up_arrow' to change the focus ,but not working.

What is the current behavior?

When i press keyboard 'down_arrow' or 'up_arrow', the focus can be changed to other menu item.

What are the steps to reproduce?

The cod in the "app.module.ts" file: import { BrowserModule } from '@angular/platform-browser'; import { NgModule, ApplicationRef } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms';

import 'hammerjs'; import { MdCoreModule } from '@angular2-material/core'; import { MdCheckboxModule } from '@angular2-material/checkbox'; import { MdInputModule } from '@angular2-material/input'; import { MdProgressCircleModule } from '@angular2-material/progress-circle'; import { MdCardModule } from '@angular2-material/card'; import { MdButtonModule } from '@angular2-material/button'; import { MdRadioModule, MdRadioGroup } from '@angular2-material/radio'; import { MdGridListModule } from '@angular2-material/grid-list'; import { MdListModule } from '@angular2-material/list'; import { MdIconModule } from '@angular2-material/icon'; import { MdButtonToggleModule } from '@angular2-material/button-toggle'; import { MdMenuModule } from '@angular2-material/menu'; import { MdProgressBarModule } from '@angular2-material/progress-bar'; import { MdTabsModule } from '@angular2-material/tabs'; import { MdSidenavModule } from '@angular2-material/sidenav'; import { MdSliderModule } from '@angular2-material/slider'; import { MdSlideToggleModule } from '@angular2-material/slide-toggle'; import { MdToolbarModule } from '@angular2-material/toolbar'; import { MdTooltipModule } from '@angular2-material/tooltip';

import { AppComponent } from './app.component';

import { MmenuComponent } from './mmenu/mmenu.component';

import 'style!@angular2-material/core/style/core.css'; import 'style!@angular2-material/core/overlay/overlay.css';

@NgModule({ declarations: [ AppComponent, MbuttonToggleComponent ], imports: [ BrowserModule, CommonModule, FormsModule, MdCoreModule, MdCheckboxModule, MdInputModule, MdProgressCircleModule, MdCardModule, MdButtonModule, MdRadioModule, MdGridListModule, MdListModule, MdIconModule, MdButtonToggleModule, MdMenuModule, MdProgressBarModule, MdTabsModule, MdSidenavModule, MdSliderModule, MdSlideToggleModule, MdToolbarModule, MdTooltipModule ], providers: [], entryComponents: [AppComponent], bootstrap: [AppComponent] }) export class AppModule {

}

The code in the "mmenu.component.ts" file: import { Component, OnInit } from '@angular/core'; import { ViewChild } from '@angular/core/index'; import { MdMenuTrigger } from '@angular2-material/menu';

@Component({ moduleId: module.id, selector: 'app-mmenu', template: <md-menu #menusk x-position="before"> <button md-menu-item> Refresh </button> <button md-menu-item> Settings </button> <button md-menu-item> Help </button> <button md-menu-item disabled> Sign Out </button> </md-menu> <button md-button [md-menu-trigger-for]="menusk">FLAT</button>, styleUrls: ['mmenu.component.css'] }) export class MmenuComponent implements OnInit { @ViewChild(MdMenuTrigger) trigger: MdMenuTrigger; constructor() { }

ngOnInit() { }

someMethod(e) { this.trigger.toggleMenu(); }

}

What is the use-case or motivation for changing an existing behavior?

Support keybord to choose the menu item.

Which versions of Angular, Material, OS, browsers are affected?

Angular 2 RC5 Material 2.0.0-alpha.7-4 Win 10 Fire fox 48.0.2

Is there anything else we should know?

No.

eric-heihei avatar Sep 21 '16 07:09 eric-heihei

Keyboard shortcuts were added in alpha.8

jelbourn avatar Sep 21 '16 16:09 jelbourn

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.