fix: increase the mapbox popup width #2077
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The actual width of the popup in the event map is only 80px, not enough to display the name of certain cities in one line and super inadequate for the city description.
My proposal is to change the CSS from
width: 80px
tomax-width: 500px
for desktop andmax-width 250px
for mobile. This can keep a small popup with smaller content as just the city name but expand for larger content. However this not completly fix the usability of the popup. For this reason I fixed the maximum height of the popop to 280px (calculated from the mobile map height) and added scrollable text in case of long text content.As-is:
![immagine](https://private-user-images.githubusercontent.com/632339/310937769-0a6e046c-7d38-4b3e-a08a-e6be49dbf58b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyOTg1NDAsIm5iZiI6MTcyMTI5ODI0MCwicGF0aCI6Ii82MzIzMzkvMzEwOTM3NzY5LTBhNmUwNDZjLTdkMzgtNGIzZS1hMDhhLWU2YmU0OWRiZjU4Yi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzE4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxOFQxMDI0MDBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05NGIwZTcwZTU4ZjhkMzk3OTA3ODE4YTM5YmRlMGM4NzRhYTJiZDMyYzc0NjdiY2UwOTI4Yjk2N2RmNTJlZDBkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.XT489wHB86U9s_SpLtbAgxA2SbWV8auHTL-bK1NUD2g)
After the patch (mobile):
![immagine](https://private-user-images.githubusercontent.com/632339/310947446-8f248b24-f89b-4d70-b484-bfaa1893f6a0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyOTg1NDAsIm5iZiI6MTcyMTI5ODI0MCwicGF0aCI6Ii82MzIzMzkvMzEwOTQ3NDQ2LThmMjQ4YjI0LWY4OWItNGQ3MC1iNDg0LWJmYWExODkzZjZhMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzE4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxOFQxMDI0MDBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05YzU0ZDM2MDQzOGU3YWI2NjA5ZWI4YmU5NzRiNjg3NTEzZmM2MTNhZjQyY2QyZmJlZDQ1NzgzMjI5NzVlMTg4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.__qTilezCrqkFVm5ccUksenYB19EpleaqqqupTREC_4)
After the path (desktop):
![immagine](https://private-user-images.githubusercontent.com/632339/310947895-58b4c55c-5e08-45b1-90c3-257cdb91ede8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyOTg1NDAsIm5iZiI6MTcyMTI5ODI0MCwicGF0aCI6Ii82MzIzMzkvMzEwOTQ3ODk1LTU4YjRjNTVjLTVlMDgtNDViMS05MGMzLTI1N2NkYjkxZWRlOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzE4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcxOFQxMDI0MDBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04NmI5OTIyNjE5ZThlNTMxNGY2NzQ4ODEwNGRkZDdiZmRiNGFmOWJhMzk3YjcxMTI1Nzc5OWRlNTJiYzVkMWM0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.tlvQod3G6sQp_UtVqimqYUff7yRvSh7gfQvP3KnOOI8)