diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-14 18:58:53 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-14 18:58:53 -0700 |
commit | 934900a67daa1c6a7782104cd27ed92b29d15fb5 (patch) | |
tree | 23df3043e7d23cc18b7ddeae7a212bcfdbc6ed8e | |
parent | 82eb354605d10275f33436c89f18384f00463c5d (diff) | |
download | trackermap-web-934900a67daa1c6a7782104cd27ed92b29d15fb5.tar.gz trackermap-web-934900a67daa1c6a7782104cd27ed92b29d15fb5.tar.bz2 trackermap-web-934900a67daa1c6a7782104cd27ed92b29d15fb5.zip |
Event type selection logic
-rw-r--r-- | modern/src/reports/EventReportPage.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modern/src/reports/EventReportPage.js b/modern/src/reports/EventReportPage.js index a0293978..92d04375 100644 --- a/modern/src/reports/EventReportPage.js +++ b/modern/src/reports/EventReportPage.js @@ -65,7 +65,15 @@ const Filter = ({ setItems }) => { <InputLabel>{t('reportEventTypes')}</InputLabel> <Select value={eventTypes} - onChange={(e) => setEventTypes(e.target.value)} + onChange={(event, child) => { + let values = event.target.value; + const clicked = child.props.value; + console.log(`${values} ${clicked}`) + if (values.includes('allEvents') && values.length > 1) { + values = [clicked]; + } + setEventTypes(values); + }} renderValue={(it) => (it.length > 1 ? it.length : it.length > 0 ? t(typesMap.get(it[0])) : it)} multiple > |