Skip to content

[Bug]: Focusable child elements in AdvancedMarkerElement #704

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

Open
mxdvl opened this issue Mar 10, 2025 · 0 comments
Open

[Bug]: Focusable child elements in AdvancedMarkerElement #704

mxdvl opened this issue Mar 10, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@mxdvl
Copy link

mxdvl commented Mar 10, 2025

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


@mxdvl mxdvl added the bug Something isn't working label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant