-
-
Notifications
You must be signed in to change notification settings - Fork 555
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
XWIKI-19723: Navigation panel not accessible using a screen reader #3789
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -37,6 +37,9 @@ | |||||
|
||||||
#macro (tree $options) | ||||||
<div #treeAttributes($options)></div> | ||||||
<span id="xtree#if($!{macro.options.id})-$!{macro.options.id}#{end}-description" class="sr-only"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we should force an ID prefix. The default ID can have a prefix (see my other comment), but if the user specifies an ID, we should use it as is, i.e. we should only add the |
||||||
$services.localization.render('tree.macro.description') | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</span> | ||||||
#end | ||||||
|
||||||
#macro (treeAttributes $options $isWikiSyntax) | ||||||
|
@@ -62,14 +65,14 @@ | |||||
$entry.key = "$escapedValue"## | ||||||
#end | ||||||
#end | ||||||
|
||||||
#macro (getTreeAttributes $options $attributes) | ||||||
#set ($macro.options = {}) | ||||||
#set ($discard = $macro.options.putAll($defaultTreeOptions)) | ||||||
#set ($discard = $macro.options.putAll($options)) | ||||||
#if ($macro.options.id) | ||||||
#set ($discard = $attributes.put('id', $macro.options.id)) | ||||||
#end | ||||||
#set ($discard = $attributes.put('aria-describedby', "xtree#if($!{macro.options.id})-$!{macro.options.id}#{end}-description")) | ||||||
#set ($classes = ["$!macro.options.get('class')"]) | ||||||
#set ($noLinks = $macro.options.links != 'true') | ||||||
#if ($noLinks) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right place. The comment above says:
We don't need the id to retrieve the tree nodes. The proper place is rather https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-tree/xwiki-platform-tree-war/src/main/webapp/templates/tree_macros.vm#L20 (that's where we set the default CSS class for instance).
As for the default id value, since we can't easily have a counter, I think we can use a random value. Here's an example https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/FileUploader.xml#L88 (timestamp + small random). I'd go with: