Skip to content

Potential focus visibility issue in annotations/hotspots #5192

Description

@Malvoz

Potential a11y issue

Annotations may fail WCAG Focus Visible and/or Focus Appearance on focus.

Steps to reproduce:

  1. Go to https://modelviewer.dev/examples/annotations/#cameraViews
  2. Tab to the first annotation/hotspot
  3. Notice how the focused annotation element and belonging focus outline is barely visible:
Image

Relevant CSS:

.annotation-wrapper.hide ::slotted(*) {
opacity: var(--min-hotspot-opacity, 0.25);
}

Potential solution

We can ensure the element and focus outline is visible on focus by not changing the opacity if there's focus-within the slotted annotation wrapper:

.annotation-wrapper.hide ::slotted(:not(:focus-within)) {
   opacity: var(--min-hotspot-opacity, 0.25);
}

Result:

The annotation and focus outline is now fully visible if there's focus within:

Image

Disclaimer

I'm not personally a user of <model-viewer>, I'm here mostly due to @svinkle's model a11y work and my interest in the <model> element proposal.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions