We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 538ff34 commit 311e8c6Copy full SHA for 311e8c6
1 file changed
index.js
@@ -33,10 +33,6 @@ class MarkdownButtonElement extends HTMLElement {
33
}
34
35
connectedCallback() {
36
- if (!this.hasAttribute('tabindex')) {
37
- this.setAttribute('tabindex', '-1')
38
- }
39
-
40
if (!this.hasAttribute('role')) {
41
this.setAttribute('role', 'button')
42
@@ -251,8 +247,11 @@ class MarkdownToolbarElement extends HTMLElement {
251
247
this.field.addEventListener('keydown', fn)
252
248
shortcutListeners.set(this, fn)
253
249
254
- const firstTabIndex = getButtons(this)[0]
255
- if (firstTabIndex) firstTabIndex.setAttribute('tabindex', '0')
250
+ let tabindex = '0'
+ for (const button of getButtons(this)) {
+ button.setAttribute('tabindex', tabindex)
+ if (tabindex === '0') tabindex = '-1'
+ }
256
257
258
disconnectedCallback() {
0 commit comments