Skip to content

feat: add accessibility - #496

Open
sebnic wants to merge 2 commits into
Orange-OpenSource:mainfrom
sebnic:feat/svg-accessibility
Open

sebnic wants to merge 2 commits into
Orange-OpenSource:mainfrom
sebnic:feat/svg-accessibility

Conversation

@sebnic

@sebnic sebnic commented Oct 12, 2026 •

Copy link
Copy Markdown

This pull request adds comprehensive keyboard accessibility support to the map, markers, clusters, and controls, along with accessible naming for interactive elements. It introduces new CSS focus styles, updates the documentation, and refactors icon generation to support ARIA labeling. The version is bumped to 2.7.0-alpha.1.

Accessibility and Keyboard Interaction Improvements:

  • Added keyboard navigation and interaction for markers, clusters, and zoom controls, including Tab navigation, Enter/Space activation, Escape to dismiss popups, and focus management. (src/iotMapManager/src/iot-map-manager.ts src/iotMapManager/src/iot-map-manager.tsR76-R144)
  • Introduced visible focus outlines and z-index adjustments for interactive elements to ensure clear keyboard focus indication. (src/iotMapManager/css/map.css [1] src/iotMapManager/css/markers.css [2]
  • Updated CSS to allow cluster popups and related elements to appear on keyboard focus, not just hover, and to hide popups when dismissed. (src/iotMapManager/css/markers.css [1] src/iotMapManager/css/popup.css [2] [3] [4] [5] src/iotMapManager/css/tabs.css [6]

ARIA and Accessible Naming:

  • Added support for accessible names (ARIA labels) for markers, clusters, user markers, areas, and path icons. These can be set via properties or configuration functions and are applied as DOM attributes. (src/iotMapManager/src/iot-map-icons.ts [1] [2] [3] [4] [5] src/iotMapManager/src/iot-map-area.ts [6] [7]
  • Extended IotMapConfig with an accessibility section, allowing configuration of cluster ARIA labels for automatic clusters. (src/iotMapManager/src/iot-map-config.ts [1] [2]

Documentation and Versioning:

  • Documented all accessibility features, keyboard interactions, and accessible naming in the README, including usage examples and manual testing instructions. (src/iotMapManager/readme.md [1] [2]
  • Bumped package version to 2.7.0-alpha.1 in package.json and package-lock.json. [1] [2]Add an opt-in configuration to hide generated icon SVGs from assistive technology while preserving map interactions and custom content.

Document configuration and scope, and bump the library minor version to 2.7.
This pull request adds comprehensive keyboard accessibility and SVG accessibility features to the map manager, along with the necessary CSS and documentation updates. It introduces visible focus indicators, keyboard navigation for markers, clusters, and zoom controls, and an option to exclude library-generated SVG icons from the accessibility tree. The changes also ensure that interactive elements inside popups behave correctly for both mouse and keyboard users.

Accessibility and Keyboard Interaction Enhancements:

  • Added visible focus outlines and high-contrast styling for focused markers, clusters, and zoom controls in map.css and markers.css, improving keyboard navigation feedback. [1] [2]
  • Updated cluster and popup visibility logic in markers.css, popup.css, and tabs.css to show popups and hide tabs when clusters or markers are focused via keyboard, matching hover behavior and supporting keyboard navigation. [1] [2] [3] [4] [5]

SVG Accessibility Option:

  • Introduced a new accessibility.hideSvgFromAssistiveTechnology config option in IotMapConfig, allowing applications to set aria-hidden="true" on all library-generated SVG icons (markers, clusters, user markers, paths) to exclude them from the accessibility tree. [1] [2] [3] [4] [5] [6] [7] [8]
  • Updated all icon creation functions to respect this option and apply the attribute as needed. [1] [2] [3] [4] [5] [6] [7]

Interactive Icon and Popup Behavior:

  • Replaced standard L.DivIcon with a custom InteractiveDivIcon to ensure that interactive controls (links, buttons, etc.) inside popups do not trigger marker or cluster actions when activated, preserving native behavior for keyboard and mouse users. [1] [2] [3]

Documentation Updates:

  • Expanded the readme.md with detailed sections on keyboard accessibility and the new SVG accessibility configuration, including usage instructions, behavioral notes, and manual validation steps. [1] [2]

Version Bump:

  • Updated package.json and package-lock.json to version 2.7.0-alpha.1 to reflect these significant accessibility improvements. [1] [2]0-alpha.1 with synchronized lockfile references.
    This pull request adds comprehensive accessibility features to the map library, focusing on keyboard navigation, visible focus indicators, and accessible names for markers, clusters, paths, and areas. It introduces new CSS for focus styling, updates the documentation, and modifies the icon rendering logic to support aria-label and aria-expanded attributes. These changes make the map more usable for keyboard and assistive technology users, while maintaining existing mouse and touch interactions.

Accessibility and keyboard navigation enhancements:

  • Added visible focus outlines and z-index adjustments for map controls, markers, and clusters to improve keyboard navigation and focus visibility (map.css, markers.css). [1] [2]
  • Extended CSS to ensure cluster and popup visibility responds to keyboard focus as well as mouse hover, and to properly hide popups when dismissed (markers.css, popup.css, tabs.css). [1] [2] [3] [4] [5] [6]

Accessible names and ARIA attributes:

  • Introduced ariaLabel support for markers, clusters, user markers, areas, and paths, and added a configuration option for cluster accessible names via clusterAriaLabel function (iot-map-config.ts, iot-map-icons.ts, iot-map-area.ts). [1] [2] [3] [4] [5] [6] [7] [8]
  • Updated icon rendering to use custom AccessibleDivIcon and InteractiveDivIcon classes, which apply aria-label and manage aria-expanded state dynamically for markers and clusters (iot-map-icons.ts). [1] [2] [3] [4] [5]

Documentation updates:

  • Expanded the README with a new section on keyboard accessibility, describing supported interactions, ARIA attributes, and how to provide accessible names for all map elements (readme.md). [1] [2]

Version bump:

  • Incremented the package version to 2.7.0-alpha.1 to reflect these significant accessibility improvements (package.json, package-lock.json). [1] [2]

Cluster and marker update logic:

  • Ensured that updating a cluster or marker's ariaLabel triggers a redraw and updates the accessible name in the DOM (iot-map-cluster-manager.ts).

These changes collectively make the map library much more accessible and user-friendly for keyboard and assistive technology users, while maintaining backward compatibility and existing interactive behaviors.

@netlify

netlify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for iotmapcomponent ready!

Name Link
🔨 Latest commit 3688d2d
🔍 Latest deploy log https://app.netlify.com/projects/iotmapcomponent/deploys/6ad11d9cc01caf1b82ac7940
😎 Deploy Preview https://deploy-preview-496--iotmapcomponent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sebnic
sebnic force-pushed the feat/svg-accessibility branch from d34c6b7 to 5fcb6af Compare October 15, 2026 12:18
sebnic and others added 2 commits October 15, 2026 20:33
Support Enter and Space activation, Escape dismissal, and visible focus indicators. Keep popup controls usable without activating their parent, and synchronize aria-expanded with popup visibility.

Add a Storybook example with marker and cluster popups to inspect their keyboard behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add an optional ariaLabel on markers, manual clusters, user markers,
paths (line, additional lines and start/end/position icons) and areas,
plus the accessibility.clusterAriaLabel config function for automatic
clusters. Labels are set as DOM attributes and nothing changes when unset.

Support accessible name updates and removal through marker, manual
cluster and user marker update APIs, including bulk updates.

Document the option and update semantics in the readme, add an
AccessibleNames story and bump the library minor version to 2.7.0-alpha.1.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sebnic
sebnic force-pushed the feat/svg-accessibility branch from 5fcb6af to 3688d2d Compare October 15, 2026 18:38
@sebnic sebnic changed the title feat: add optional SVG accessibility hiding feat: add accessibility Oct 15, 2026

This branch has not been deployed

No deployments
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