diff --git a/web/src/components.ts b/web/src/components.ts index f17b4d2295..fbaabe2abb 100644 --- a/web/src/components.ts +++ b/web/src/components.ts @@ -116,7 +116,7 @@ export function toggle(opts: { } meta.$ind_tab.on("click", function () { - const idx = $(this).data("tab-id"); + const idx = Number($(this).attr("data-tab-id")); select_tab(idx); }); diff --git a/web/tests/components.test.js b/web/tests/components.test.js index 650f219d41..47854ed79a 100644 --- a/web/tests/components.test.js +++ b/web/tests/components.test.js @@ -33,8 +33,8 @@ function make_tab(i) { return tokens.includes(c); }; - $self.data = (name) => { - assert.equal(name, "tab-id"); + $self.attr = (name) => { + assert.equal(name, "data-tab-id"); return i; };