Gathering detailed insights and metrics for mat-row-keyboard-selection
Gathering detailed insights and metrics for mat-row-keyboard-selection
Gathering detailed insights and metrics for mat-row-keyboard-selection
Gathering detailed insights and metrics for mat-row-keyboard-selection
A very simple directive that allows toggle SelectionModel when user focus a mat-row and press keyboard arrows up and down.
npm install mat-row-keyboard-selection
Typescript
Module System
Node Version
NPM Version
TypeScript (62.15%)
HTML (23.36%)
JavaScript (11.99%)
CSS (2.5%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
5 Stars
11 Commits
1 Forks
1 Watchers
29 Branches
1 Contributors
Updated on Dec 19, 2023
Latest Version
1.3.0
Package Id
mat-row-keyboard-selection@1.3.0
Unpacked Size
103.80 kB
Size
19.88 kB
File Count
24
NPM Version
6.4.1
Node Version
10.14.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
4
https://douglasgsouza.github.io/mat-row-keyboard-selection/
This is a simple directive that allows navigate Angular Material Data Table with keyboard. This allow Focus MatRow and toogle SelectionModel using keyboard TAB, arrows Up, Down, Enter and Space.
Made with :heart: in Brazil.
Install the package by command:
1 npm install mat-row-keyboard-selection --save
Import the module
1import { MatRowKeyboardSelectionModule } from "mat-row-keyboard-selection"; 2 3@NgModule({ 4 imports: [ 5 ... 6 MatRowKeyboardSelectionModule 7 ], 8 declarations: [...], 9 providers: [...] 10}) 11export class AppModule {}
or import only Directive
1import { MatRowKeyboardSelectionDirective } from "mat-row-keyboard-selection"; 2 3@NgModule({ 4 declarations: [MatRowKeyboardSelectionDirective], 5}) 6export class YourModule {}
With <table mat-table>
1 <table mat-table [dataSource]="dataSource1"> 2 .... 3 <tr mat-row [matRowKeyboardSelection]="selectionModel" [rowModel]="row" *matRowDef="let row; columns: displayedColumns;"></tr>
With <mat-table>
1 <table mat-table [dataSource]="dataSource1"> 2 .... 3 <mat-row [matRowKeyboardSelection]="selectionModel" [rowModel]="row" *matRowDef="let row; columns: displayedColumns;"></mat-row>
Keyboard Keys:
Tab
- Focus a row or next element (follow the native tabindex).Space
and Enter
- When row focused, toggle row. (Can be disabled with option toggleOnEnter
= false
)Arrow Down
- Move focus to next row.Arrow Up
- Move focus to previous row.Case selectOnFocus
is True
model is selected when row is focused.
You can set options...
1 <tr mat-row [matRowKeyboardSelection]="selectionModel" [rowModel]="row" [selectOnFocus]="true" [deselectOnBlur]="true" *matRowDef="let row; columns: displayedColumns;"></tr>
Available options:
selectOnFocus
- Automatic select on row focus. (default: false
)
on click
or checkbox selection
I recommend not enable this option and let your component decide when to make selection.deselectOnBlur
- Automatic deselect on row blur. (default: false
)toggleOnEnter
- Toggle Row on press Enter or Space. (default: true
)preventNewSelectionOnTab
- Prevent next row Focus on Tab. (default: false
)Tested and made with on Angular 7.3.
MIT @ Douglas Gomes de Souza
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/11 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
150 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More