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

fix: force table cell content to wrap to prevent overly wide modal #2961

Merged
merged 3 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/map/layers/EventPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, { useEffect } from 'react'
import { EVENT_ID_FIELD } from '../../../util/geojson.js'
import { formatTime, formatCoordinate } from '../../../util/helpers.js'
import Popup from '../Popup.js'
import classes from './styles/EventPopup.module.css'

// Returns true if value is not undefined or null;
const hasValue = (value) => value !== undefined || value !== null
Expand Down Expand Up @@ -87,7 +88,7 @@ const EventPopup = ({
<Popup
coordinates={coordinates}
onClose={onClose}
className="dhis2-map-popup-event"
className={classes.eventPopup}
>
{error && <span>{i18n.t('Could not retrieve event data')}</span>}
{!error && (
Expand Down
20 changes: 20 additions & 0 deletions src/components/map/layers/styles/EventPopup.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.eventPopup {
max-height: 300px;
overflow: auto;
line-height: 14px;
max-width: 400px;
}

.eventPopup th, .eventPopup td {
text-align: left;
vertical-align: top;
}

.eventPopup tr th {
font-weight: 500;
padding-right: var(--spacers-dp4);
}

.eventPopup tr td {
min-width: 120px;
}
8 changes: 2 additions & 6 deletions src/components/map/styles/Popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
min-width: 150px;
}

.dhis2-map-popup-event {
overflow-x: auto;
}

.dhis2-map-popup-event th {
text-align: left;
.maplibregl-popup-close-button:focus {
outline: none;
}
Loading