Skip to content

Commit

Permalink
Scrollable table? Make keyboard accessible (focusable)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabalafou committed Jun 26, 2024
1 parent b18ebb2 commit 88c5a48
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,9 @@ function showVersionWarningBanner(data) {
const timeout_in_days = 14;
if (days_passed < timeout_in_days) {
console.info(
`[PST] Suppressing version warning banner; was dismissed ${Math.floor(days_passed)} day(s) ago`,
`[PST] Suppressing version warning banner; was dismissed ${Math.floor(
days_passed,
)} day(s) ago`,
);
return;
}
Expand Down Expand Up @@ -727,10 +729,18 @@ function addTabStopsToScrollableElements() {
const updateTabStops = () => {
document
.querySelectorAll(
"pre, " + // code blocks
".nboutput > .output_area, " + // NBSphinx notebook output
".cell_output > .output, " + // Myst-NB
".jp-RenderedHTMLCommon", // ipywidgets
[
// code blocks
"pre",
// NBSphinx notebook output
".nboutput > .output_area",
// Myst-NB
".cell_output > .output",
// ipywidgets
".jp-RenderedHTMLCommon",
// [rST table nodes](https://www.docutils.org/docs/ref/doctree.html#table)
".pst-scrollable-table-container",
].join(", "),
)
.forEach((el) => {
el.tabIndex =
Expand Down

0 comments on commit 88c5a48

Please sign in to comment.