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

SVG tag doesn't render attributes with "false" as value. #2844

Closed
steffen25 opened this issue Nov 15, 2020 · 0 comments · Fixed by #2845
Closed

SVG tag doesn't render attributes with "false" as value. #2844

steffen25 opened this issue Nov 15, 2020 · 0 comments · Fixed by #2845
Labels

Comments

@steffen25
Copy link
Contributor

Bug Description

Im creating a accordion element and Im looking at the best practises for user accessibility for such element specified by the W3 organisation:

https://www.w3.org/TR/wai-aria-practices-1.1/examples/accordion/accordion.html

Im using an SVG for the caret icon and in IE11 SVG tags gets focused automatically which means that I have to tab twice in order to focus the next panel.
I did a few Google searches and it looks like you have to give the SVG tag a focusable="false".
False values is ignored by this line:
https://github.com/damcclean/cms/blob/master/src/Tags/Concerns/RendersAttributes.php#L17
Focusable attribute:
https://www.w3.org/TR/SVGTiny12/interact.html#focusable-attr

A quick workaround for the IE11 "focus-bug" is just to use the disabled attribute disabled="true" but focusable IMO seems more semantically correct and should be preferred over disabled=true?

How to Reproduce

  1. Add an SVG tag
  2. Give it a false attribute e.g. focusable="false"
  3. focusable="false" is not rendered as an attribute on the SVG tag.

Extra Detail

5e6b8a0f563a141f5ca3a4ee7cfd7b0d
IE11 doesnt show that the SVG caret is in focus so this gif is just to show you my accordion.

Environment

Statamic 3.0.27 Pro
Laravel 7.29.3
PHP 7.4.11

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

Successfully merging a pull request may close this issue.

2 participants