-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
additional accessibility guidance for popover #8791
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 |
---|---|---|
|
@@ -81269,6 +81269,17 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> { | |
won't be rendered until it becomes shown, at which point it will be rendered on top of other page | ||
content.</p> | ||
|
||
<div class="note"> | ||
<p>The <code data-x="attr-popover">popover</code> attribute is a global attribute that allows | ||
authors flexibility to ensure popover functionality can be applied to the most appropriate semantic element which represents the purpose of the popover.</p> | ||
<p>Authors can use the <code data-x="attr-popover">popover</code> attribute on generic | ||
elements, such as <code>div</code>, or author defined | ||
<span data-x="custom element">custom elements</span>. However, it will often be the case that | ||
authors will need to ensure proper accessibility semantics are also provided to these otherwise | ||
generic elements. For instance, by also specifying the appropriate ARIA roles and properties | ||
which represent the type of popover they have created.</p> | ||
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 think it would be more helpful for readers if this were an example. 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. there were already examples in the next section that i had relied upon, but glad to can add another one here. 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. So in particular what I'm looking for is an example where it's made accessible through augmentation of the markup. I don't think we cover that at the moment? 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. Should there also be a sentence or two talking about how you can also use non-generic, semantic elements like |
||
</div> | ||
|
||
<p>The <code data-x="attr-popover">popover</code> attribute is an <span>enumerated | ||
attribute</span>. The following table lists the states for this attribute:</p> | ||
|
||
|
@@ -81931,28 +81942,34 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> { | |
attribute is specified, then that attribute's value must be the ID of element with the <code | ||
data-x="attr-popover">popover</code> attribute.</p> | ||
|
||
<p class="note">To help ensure a popover will be programmatically exposed in a logical reading | ||
order to users of assistive technology, for most authors will need to place the popover | ||
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. "for most" doesn't read correctly to me. 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. ah yup. that was a rewrite of the sentence that i clearly didn't finish. will fix. 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. How about this?
|
||
element immediately after the triggering element in the DOM.</p> | ||
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. Why is this the case actually? Wouldn't a popover not be rendered and therefore not be read? 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. maybe i need to clarify this, as your question isn't inline with what this is meant to be about. yes, if a popover is not rendered it's not going to be read. but when one is rendered it'll generally be best to have it in the DOM directly after the trigger that invoked it so that someone using a screen reader and navigating using the virtual cursor (not tab key) will be able to easily find the popover (if it's placed at the bottom of the DOM, for instance, it'll be quite difficult to find, and placing it there sort of defeats one of the benefits to this feature). |
||
|
||
<div class="example"> | ||
<p>The following shows how <code data-x="attr-popover-show-target">popovershowtarget</code> can | ||
be used to open a popover:</p> | ||
|
||
<pre><code class="html"><div popover=auto id="foo"> | ||
This is a popover! | ||
</div> | ||
|
||
<button popovershowtarget="foo"> | ||
<pre><code class="html"><button popovershowtarget="foo"> | ||
Show a popover | ||
</button></code></pre> | ||
</button></code> | ||
|
||
<ul popover=auto id="foo"> | ||
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. id=links then? |
||
<!-- This is a popover list of links! --> | ||
<li><a href="...">...</a></li> | ||
... | ||
</ul></pre> | ||
|
||
<p>The following shows how <code data-x="attr-popover-toggle-target">popovertoggletarget</code> | ||
can open and close a manual popover, which can't be closed with light dismiss:</p> | ||
|
||
<pre><code class="html"><div popover=manual id="foo"> | ||
This is a popover! | ||
</div> | ||
|
||
<button popovertoggletarget="foo"> | ||
<pre><code class="html"><button popovertoggletarget="foo"> | ||
Show or hide a popover | ||
</button></code></pre> | ||
</button></code> | ||
|
||
<div popover=manual id="foo"> | ||
This is a popover! | ||
</div></pre> | ||
</div> | ||
|
||
<span data-x="concept-element-dom">DOM interface</span>: | ||
|
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.
Single-space indentation and wrapping at a 100 columns please.