![github-actions[bot]](/assets/img/avatar_default.png)
* Add html to rule S6823 * Remove HTML mention in "How to fix it" --------- Co-authored-by: ericmorand-sonarsource <ericmorand-sonarsource@users.noreply.github.com> Co-authored-by: Eric MORAND <eric.morand@sonarsource.com>
27 lines
584 B
Plaintext
27 lines
584 B
Plaintext
include::../common/rule.adoc[tag=header]
|
|
|
|
== How to fix it in JSX
|
|
|
|
Make sure that DOM elements with the `aria-activedescendant` property have a `tabIndex` property, or use an element with an inherent one.
|
|
|
|
=== Code examples
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,javascript,diff-id=1,diff-type=noncompliant]
|
|
----
|
|
<div aria-activedescendant={descendantId}>
|
|
{content}
|
|
</div>
|
|
----
|
|
|
|
==== Compliant solution
|
|
|
|
[source,javascript,diff-id=1,diff-type=compliant]
|
|
----
|
|
<div aria-activedescendant={descendantId} tabIndex={0}>
|
|
{content}
|
|
</div>
|
|
----
|
|
|
|
include::../common/rule.adoc[tag=footer] |