react-google-maps-api icon indicating copy to clipboard operation
react-google-maps-api copied to clipboard

Custom attributes not being passed to DOM element in GoogleMap component

Open alamenai opened this issue 9 months ago • 0 comments

Currently, when using the GoogleMap component with a data-testid attribute, the attribute is not being passed through to the rendered DOM element. This makes it difficult to select the map container element in testing environments.

Example of current usage:

<GoogleMap
  data-testid="google-map"
  // other props...
/>

Expected behavior:

The data-testid attribute should be passed to the underlying map container div element

Current behavior:

The data-testid attribute is not being passed through and is missing from the rendered DOM

This affects the ability to select the map element in testing frameworks like Cypress, Jest, or Playwright that rely on data-testid attributes for element selection.

Proposed solution:

Could you please add support for passing through HTML attributes (including data-* attributes) to the underlying container element?

alamenai avatar Feb 12 '25 09:02 alamenai