Accessibility in Angular Chips component
15 Sep 20222 minutes to read
Keyboard interaction
The following shortcut keys are used to access the Chip control without any interruption.
Keyboard shortcuts | Actions |
---|---|
Enter | Selects the targeted chip from the ChipList/ChipCollection. |
Delete | Deletes the targeted chip from the ChipList/ChipCollection. |
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'my-app',
// specifies the template string for the Chip component
template: `
<ejs-chiplist id="chip" [enableDelete]="true" selection="Single">
<e-chips>
<e-chip text="Andrew" avatarIconCss='andrew'></e-chip>
<e-chip text="Janet" avatarIconCss='janet'></e-chip>
<e-chip text="Laura" avatarIconCss='laura'></e-chip>
<e-chip text="Margaret" avatarIconCss='margaret'></e-chip>
</e-chips>
</ejs-chiplist>`
})
export class AppComponent {
}
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ChipListModule } from '@syncfusion/ej2-angular-buttons';
import { AppComponent } from './app.component';
import { enableRipple } from '@syncfusion/ej2-base';
enableRipple(true);
/**
* Module
*/
@NgModule({
imports: [
BrowserModule,
ChipListModule
],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';
enableProdMode();
platformBrowserDynamic().bootstrapModule(AppModule);