mapbox / mapbox/mapbox-gl-geocoder

Mapbox geocoder [map.addControl(geocoder);] distorts in WordPress

Open
#504 0 comments 0 reactions 0 assignees View on GitHub
auto-triaged needs information
Dominant language
JavaScript
Stars
388
Forks
181
PR merge metrics
No merged PRs in 30d

Description

I have added the Mapbox geocoder to my web map in the top-left position and made it collapsible.

![image](https://github.com/mapbox/mapbox-gl-geocoder/assets/120218025/fd3af4c1-7b66-4170-8e5d-d5957c7e8a84)

As raw HTML it looks and works as expected.
![image](https://github.com/mapbox/mapbox-gl-geocoder/assets/120218025/2c4fdfe6-5528-405c-99e8-4698dc0a12f0)

However, once the code is copied and added into WordPress as a code block it completely distorts.
![image](https://github.com/mapbox/mapbox-gl-geocoder/assets/120218025/51281ed0-204f-4c54-9ef5-47ca6a2f4a7d)

Can't seem to figure out what causes this or how to fix it. Any thoughts?

Here is a copy of the current code:
[GeocoderIssue.txt](https://github.com/mapbox/mapbox-gl-geocoder/files/12261301/GeocoderIssue.txt)

Contributor guide

Open the contributing guide

Research direction

Start with the attached GeocoderIssue.txt and compare the raw HTML rendering with the WordPress code-block rendering, including the map.addControl(geocoder) setup. Identify whether WordPress changes the markup or applies conflicting styles; done means the collapsible top-left geocoder renders correctly in WordPress as it does in raw HTML.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.