visgl / visgl/react-google-maps
[Bug]: Focusable child elements in AdvancedMarkerElement
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 193
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 13
Description
Description
When displaying an <input type="number"> inside an <AdvancedMarker />, every click triggers the following console message:
Focusable child elements in AdvancedMarkerElement are not supported. To make AdvancedMarkerElement focusable, use addListener() to register a "click" event on the AdvancedMarkerElement instance.
Steps to Reproduce
import React from 'react';
import { AdvancedMarker } from '@vis.gl/react-google-maps';
function Component() {
const [value, setValue] = React.useState(String(500));
return (
<AdvancedMarker position={{ lat: 51, lng: 0 }}>
<input
type="number"
value={value}
onChange={({ target }) => setValue(target.value)}
/>
</AdvancedMarker>
);
}
See CodeSandBox, but somehow the Advanced Markers are not displaying
Environment
- Library version: 1.5.1 & 1.1.0
- Google maps version: weekly
- Browser and Version: Chrome 134
- OS: macOS
Logs
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the AdvancedMarker component and reproduce the warning using the provided React example with an input child. Trace how focusable children are handled and determine the expected behavior for interactive content inside AdvancedMarkerElement; done should be demonstrated by the reproduction no longer producing the reported warning or interaction problem.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100