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

Suggestions appear underneath other map corner controls #230

Closed
jwasilgeo opened this issue Oct 28, 2019 · 4 comments
Closed

Suggestions appear underneath other map corner controls #230

jwasilgeo opened this issue Oct 28, 2019 · 4 comments
Labels

Comments

@jwasilgeo
Copy link
Contributor

Suggestions appear underneath other map corner controls when the optional position property is either 'topleft' or 'topright'. Simply changing the z-index value does not appear to be a successful quick fix.

See more here:

/*
TODO: find out why this is underneath other map corner controls
(try out a "topright" position and then suggestions will be under the attribution
or another geocoder in the "bottomright")
*/
.geocoder-control-suggestions {
width: 100%;
position: absolute;
top: 26px;
left: 0;
margin-top: 10px;
overflow: auto;
display: none;
}

image

@jwasilgeo jwasilgeo added the Bug label Oct 28, 2019
@sheeley820
Copy link
Contributor

sheeley820 commented Sep 19, 2024

Describe the problem

When the Geocoder search control is above other controls, the places results get placed underneath those controls. See image:
image

Describe the proposed solution

Leaflet controls are assigned a z-index of 800. If we simply add z-index: 801 to the geocoder-control-element class definition it puts the places list on top of other leaflet controls.

.geocoder-control.leaflet-control {
  z-index: 801;
}

I can create a PR for this if it seems reasonable. See image:
image

Alternatives considered

Re-ordering the controls so that Geocoder is always alone, or always on the bottom. But this is not what we want.

Additional Information

No response

@gavinr-maps
Copy link
Contributor

Thanks for the additional info @sheeley820. I noticed the original item referenced:

Simply changing the z-index value does not appear to be a successful quick fix.

So I'm wondering what that's referring to. But if you want to submit a PR for the z-index change and then we can do some testing, I'm ok with that.

@sheeley820
Copy link
Contributor

@gavinr-maps Jacob thought, like I initially did, that the z-index needed to target the suggestions list (.geocoder-control-suggestions), but it needed to be on the control element as a whole. Since .leaflet-control defines control z-index as 800 setting a higher z-index on child elements doesn't work.

Pull request here

@patrickarlt
Copy link
Contributor

@sheeley820 I just released 3.15. It should be available on NPM and the CDD now! Thanks for the PR.

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

No branches or pull requests

4 participants