visgl / visgl/react-google-maps

[Bug]: Focusable child elements in AdvancedMarkerElement

Open
#704 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.