A11Y: add aria tags for topic map expansion (#20122)

This commit is contained in:
Kris 2023-02-02 09:36:00 -05:00 committed by GitHub
parent 3cb8be706c
commit bb2341b82c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -254,6 +254,8 @@ createWidget("topic-map-summary", {
? "topic.expand_details"
: "topic.collapse_details",
icon: state.collapsed ? "chevron-down" : "chevron-up",
ariaExpanded: state.collapsed ? "false" : "true",
ariaControls: "topic-map-expanded",
action: "toggleMap",
className: "btn",
})
@ -296,7 +298,7 @@ createWidget("topic-map-link", {
});
createWidget("topic-map-expanded", {
tagName: "section.topic-map-expanded",
tagName: "section.topic-map-expanded#topic-map-expanded",
buildKey: (attrs) => `topic-map-expanded-${attrs.id}`,
defaultState() {