Skip to content
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

[docs] React control example doesn't really work #1089

Open
7 tasks done
hooch opened this issue Aug 25, 2023 · 0 comments
Open
7 tasks done

[docs] React control example doesn't really work #1089

hooch opened this issue Aug 25, 2023 · 0 comments

Comments

@hooch
Copy link

hooch commented Aug 25, 2023

Bug report in v4 (docs)

  • All peer dependencies are installed: React, ReactDOM and Leaflet.
  • Using the latest version of React and ReactDOM v18.
  • Using the supported version of Leaflet (v1.8.0 minimum) and its corresponding CSS file is loaded.
  • Using the latest v4 version of React-Leaflet.
  • The issue has not already been reported.
  • Make sure you have followed the quick start guide for Leaflet.
  • Make sure you have fully read the documentation and that you understand the limitations.

The provided documentation for creating a React component-based leaflet-style control don't properly insert the control into Leaflet's control hierarchy.

<div className={positionClass}>
  <div className="leaflet-control leaflet-bar">{minimap}</div>
</div>

Expected behavior

The control stacks with other controls within the same positionClass.

Actual behavior

The control sits on top of other controls in the same positionClass making them inaccessible and effectively invisible.

Steps to reproduce

An example of the ZoomControl being hidden behind the example React control is available here

I'm interested to see if the React control example can be updated in such a way to make this work as expected.

Alternatively, for what it's worth, I was able to resolve my problem by using a third party package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant