Skip to content

Conversation

@KenTandrian
Copy link
Collaborator

This PR fixes an accessibility issue where the "Track Santa" button (the Santa hat icon) on the tracker map was announced as "object object" by screen readers. This was due to a missing aria-label on the button instance and an issue with how the santa-button component handled undefined attributes.

Changes

  • Accessible Label: Added an aria-label to the Santa hat button in modvil-tracker.js using the localized string tracker_track (e.g., "Track Santa"). This ensures screen readers clearly announce the button's purpose and action.
  • Component Attribute Handling: Refactored SantaButtonElement in santa-button.js to properly use ifDefined for aria-label and aria-expanded. This prevents nothing or undefined values from being rendered as stringified objects (like "object object") in the DOM.

Impacted UI components

  • Santa Tracker Map (modvil-tracker)
  • Santa Button (santa-button)

@KenTandrian KenTandrian changed the title A11y/track santa button fix(a11y): enhance label on track santa button Dec 23, 2025
@KenTandrian
Copy link
Collaborator Author

Before:

track santa before

After:

track santa after

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant