mapbox / mapbox/mapbox-gl-geocoder

width should be left to 100%

Open
#373 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged enhancement
Dominant language
JavaScript
Stars
388
Forks
181
PR merge metrics
No merged PRs in 30d

Description

**mapbox-gl-js version**:
v1.11.0

**browser**: Chrome

### Steps to Trigger Behavior

https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-geocoder-outside-the-map/

Remove the hacks on the page (geocoder class position absolute...) and try to make the text input 100% width.
This class prevents it:
```
@media screen and (min-width: 640px)
.mapboxgl-ctrl-geocoder {
width: 33.3333%;
font-size: 15px;
line-height: 20px;
max-width: 360px;
}
```
That page even has a hack to fix this:
```
.mapboxgl-ctrl-geocoder {
min-width: 100%;
}
```

Please remove both width styles from ```mapboxgl-ctrl-geocoder``` and let us style it like any html, so it fits it's container size by default.

### Expected Behavior

100% width by default on all screen sizes. Developers can add containers as they wish.

### Actual Behavior
![Screenshot from 2020-06-23 22-33-58](https://user-images.githubusercontent.com/1283842/85450957-09163080-b5a2-11ea-88a1-6493d7b32191.png)

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 linked Mapbox GL JS geocoder example and search the geocoder control styles for .mapboxgl-ctrl-geocoder, especially the media-query width rules shown in the issue. Remove the conflicting default width styles and verify that the control fills its container at all screen sizes without the example's workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.