Skip to content

Commit

Permalink
Allow ids for content tabs with special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Jul 2, 2022
1 parent 940cfb2 commit 209856e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.0238f547.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.382fbf4b.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script>
{% endfor %}
Expand Down
6 changes: 3 additions & 3 deletions src/assets/javascripts/components/content/tabs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ export function watchContentTabs(
const initial = inputs.find(input => input.checked) || inputs[0]
return merge(...inputs.map(input => fromEvent(input, "change")
.pipe(
map(() => getElement<HTMLLabelElement>(`label[for=${input.id}]`))
map(() => getElement<HTMLLabelElement>(`label[for="${input.id}"]`))
)
))
.pipe(
startWith(getElement<HTMLLabelElement>(`label[for=${initial.id}]`)),
startWith(getElement<HTMLLabelElement>(`label[for="${initial.id}"]`)),
map(active => ({ active }))
)
}
Expand Down Expand Up @@ -196,7 +196,7 @@ export function mountContentTabs(
for (const input of getElements<HTMLInputElement>(
":scope > input", set
)) {
const label = getElement(`label[for=${input.id}]`)
const label = getElement(`label[for="${input.id}"]`)
if (label.innerText.trim() === tab) {
input.click()
break
Expand Down

0 comments on commit 209856e

Please sign in to comment.