Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused summary #15

Closed
wants to merge 1 commit into from
Closed

Remove unused summary #15

wants to merge 1 commit into from

Conversation

kleinfreund
Copy link
Contributor

The summary variable is never referenced in its scope and has no apparent purpose.

@javan
Copy link
Owner

javan commented Dec 4, 2018

Thanks, it looks like this got borked in the rewrite. We were previously setting aria-expanded on the <summary> element:

polyfillToggle = ->
onTogglingTrigger (element) ->
summary = element.querySelector("summary")
if element.hasAttribute("open")
element.removeAttribute("open")
summary.setAttribute("aria-expanded", false)
else
element.setAttribute("open", "")
summary.setAttribute("aria-expanded", true)

@muan, which one is correct? Should aria-expanded live on <details> or <summary>?. Based on the W3C guide, I would think it belongs on <details>, e.g.:

<details aria-expanded="true" open></details>
<details aria-expanded="false"></details>

@kleinfreund
Copy link
Contributor Author

kleinfreund commented Dec 4, 2018

Keep in mind that it’s currently set on both details and summary. Further down, there is another line setting the initial aria-expanded on the summary element. (im currently on mobile)

@javan
Copy link
Owner

javan commented Dec 4, 2018

Right, we previously only set it on <summary> (see prior code above), which is why the variable you removed in this PR exists. I accidentally changed it to <details> in 1d17534#diff-1fdf421c05c1140f6d71444ea2b27638R68.

@muan
Copy link
Collaborator

muan commented Dec 4, 2018

It should be on summary(the “button” in this case). Quoted from references in #5:

When the details element content is shown, on the summary element (ROLE_SYSTEM_PUSHBUTTON), set STATE_SYSTEM_EXPANDED.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants