Skip to content

Commit a836841

Browse files
author
Colin Finger
committed
~
1 parent ebe16ca commit a836841

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/quill/.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"@typescript-eslint/ban-types": "off",
3737
"@typescript-eslint/no-explicit-any": "off",
3838
"import/no-named-as-default-member": "off",
39-
"prefer-arrow-callback": "error"
39+
"prefer-arrow-callback": "error",
40+
"endOfLine": "auto"
4041
}
4142
}
4243
]

packages/quill/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "quill",
3-
"version": "2.0.3",
3+
"version": "2.0.3-beta.2",
44
"description": "Your powerful, rich text editor",
55
"author": "Jason Chen <jhchen7@gmail.com>",
66
"homepage": "https://quilljs.com",

packages/quill/src/modules/toolbar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ class Toolbar extends Module<ToolbarProps> {
133133
}
134134
this.update(range);
135135
});
136+
input.tabIndex = 123;
136137
this.controls.push([format, input]);
137138
}
138139

packages/quill/src/ui/picker.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ class Picker {
3434
this.escape();
3535
event.preventDefault();
3636
break;
37+
case 'ArrowLeft':
38+
case 'ArrowRight':
39+
this.toggleTabIndex();
3740
default:
3841
}
3942
});
@@ -48,6 +51,10 @@ class Picker {
4851
toggleAriaAttribute(this.options, 'aria-hidden');
4952
}
5053

54+
toggleTabIndex() {
55+
this.label.tabIndex = this.label.tabIndex === 0 ? -1 : 0;
56+
}
57+
5158
buildItem(option: HTMLOptionElement) {
5259
const item = document.createElement('span');
5360
// @ts-expect-error
@@ -85,8 +92,11 @@ class Picker {
8592
const label = document.createElement('span');
8693
label.classList.add('ql-picker-label');
8794
label.innerHTML = DropdownIcon;
95+
96+
// TODO: @cofi set all tabindex to -1 initially and then per JS set first one to 0. Then per keyboard right/left navigation set the next/prev to 0 and the rest to -1
8897
// @ts-expect-error
89-
label.tabIndex = '0';
98+
label.tabIndex = '-1';
99+
90100
label.setAttribute('role', 'button');
91101
label.setAttribute('aria-expanded', 'false');
92102
this.container.appendChild(label);

0 commit comments

Comments
 (0)