Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #9 from andrewharvey/tabindex0
Browse files Browse the repository at this point in the history
use tabindex="0"
  • Loading branch information
andrewharvey authored May 8, 2018
2 parents 1dc489b + 8c815fd commit e95673d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ export default class MapboxAccessibility {

queryFeatures = () => {
this.features = this.map.queryRenderedFeatures({ layers: this.options.layers });
this.features.map((feature, index) => {
this.features.map((feature) => {
const { width, height } = this.options;
const position = this.map.project(feature.geometry.coordinates);
const label = feature.properties[this.options.accessibleLabelProperty];

feature.marker = document.createElement('button');
feature.marker.setAttribute('aria-label', label);
feature.marker.setAttribute('title', label);
feature.marker.setAttribute('tabindex', index);
feature.marker.setAttribute('tabindex', 0);
feature.marker.style.display = 'block';
feature.marker.style.width = `${width}px`;
feature.marker.style.height = `${height}px`;
Expand Down

0 comments on commit e95673d

Please sign in to comment.