Skip to content

Commit

Permalink
feat: support for aria
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjun1011 committed May 28, 2020
1 parent 3a26ed3 commit 16c793b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/toast/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "universal-toast",
"author": "rax",
"version": "1.2.0",
"version": "1.2.1",
"description": "",
"main": "lib/index.js",
"files": [
Expand Down
3 changes: 3 additions & 0 deletions packages/toast/src/web/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ function showToastWindow(message: string): void {
if (!toastWin) {
toastWin = document.createElement('div');
toastWin.setAttribute('role', 'alert');
// support for ARIA, add tabindex for focus
// https://developer.mozilla.org/zh-CN/docs/Web/HTML/Global_attributes/tabindex
toastWin.setAttribute('tabindex', '-1');
for (let key in styles.container) {
toastWin.style[key] = styles.container[key];
}
Expand Down

0 comments on commit 16c793b

Please sign in to comment.