Skip to content

Commit

Permalink
fix: (to test) API: set keyboard focus in modal() content area
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgurney committed Feb 1, 2025
1 parent 2831f18 commit f70a763
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Api/NtbModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,16 @@ export class NtbModal extends Modal {
});
});

this.contentEl.tabIndex = 1;
setTimeout(() => {
this.contentEl.focus();
}, 50);

// TODO: try if above doesn't work
// this.plugin.registerDomEvent(this.contentEl, 'touchend', () => {
// setTimeout(() => this.contentEl.focus(), 0);
// }, { once: true });

this.resolve = resolve;
this.reject = reject;
this.open();
Expand Down

0 comments on commit f70a763

Please sign in to comment.