-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aria-Label not set by mapbox-gl [Bug] #2115
Labels
Comments
ramonklanke
changed the title
Aria-Labe not set by mapbox-gl [Bug]
Aria-Label not set by mapbox-gl [Bug]
Jan 31, 2023
That looks reasonable. Would you open a PR to fix it? |
I don't have rights to push my changes ... |
ramonklanke
added a commit
to ramonklanke/react-map-gl
that referenced
this issue
Apr 13, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When adding a [aria-label] attibute to the child element of a marker, this should be copied to the marker itself.
Based on the code of the underlying mapbox-gl-js library.:
https://github.com/mapbox/mapbox-gl-js/blob/1621f7f75597d56318f7ca12a9494f05a94cdabf/src/ui/marker.js#L166
but because of the creation of a new div element in this marker wrapper this feature isn't triggered.
react-map-gl/src/components/marker.ts
Line 100 in 109c334
and we end-up with all markers that have the same [aria-label] = "Map marker"
Expected Behavior
aria-label of child element should be copied to the marker.
Steps to Reproduce
<Marker longitude={long} latitude={lat}><div aria-label="welcome home">home</div></Marker>
will end-up with a marker aria-label="Map marker" instead of "welcome home"
possible fix:
`
const marker = useMemo(() => {
.....
`
Environment
Logs
No response
The text was updated successfully, but these errors were encountered: