Skip to content

Commit ff7c89e

Browse files
authored
Merge pull request #154 from GNS-Science/feature/MFD_bar_chart
mfd lines menu closes on click;
2 parents 35e6f71 + 056e1fb commit ff7c89e

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gns-science/toshi-nest",
3-
"version": "3.9.5",
3+
"version": "3.9.6",
44
"description": "The toshi-nest is for fledgling work e.g. reusable Node components to share across TUI and other projects",
55
"main": "dist/index.cjs.js",
66
"module": "dist/index.esm.js",

src/MfdPlot/MfdPlot.tsx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,29 @@ export const MfdPlot = ({
7070
style={{ zIndex: 120001 }}
7171
>
7272
<RadioGroup aria-labelledby="radio-buttons-group-label" defaultValue="Incremental" name="radio-buttons-group" onChange={handleRadioChange}>
73-
<MenuItem>
74-
<FormControlLabel checked={linesToDisplay === 'Incremental'} value="Incremental" control={<Radio />} label="Incremental" />
73+
<MenuItem
74+
onClick={() => {
75+
setLinesToDisplay('Incremental');
76+
handleClose();
77+
}}
78+
>
79+
<FormControlLabel onClick={handleClose} checked={linesToDisplay === 'Incremental'} value="Incremental" control={<Radio />} label="Incremental" />
7580
</MenuItem>
76-
<MenuItem>
77-
<FormControlLabel checked={linesToDisplay === 'Cumulative'} value="Cumulative" control={<Radio />} label="Cumulative" />
81+
<MenuItem
82+
onClick={() => {
83+
setLinesToDisplay('Cumulative');
84+
handleClose();
85+
}}
86+
>
87+
<FormControlLabel onClick={handleClose} checked={linesToDisplay === 'Cumulative'} value="Cumulative" control={<Radio />} label="Cumulative" />
7888
</MenuItem>
79-
<MenuItem>
80-
<FormControlLabel checked={linesToDisplay === 'Both'} value="Both" control={<Radio />} label="Both" />
89+
<MenuItem
90+
onClick={() => {
91+
setLinesToDisplay('Both');
92+
handleClose();
93+
}}
94+
>
95+
<FormControlLabel onClick={handleClose} checked={linesToDisplay === 'Both'} value="Both" control={<Radio />} label="Both" />
8196
</MenuItem>
8297
</RadioGroup>
8398
</Menu>

0 commit comments

Comments
 (0)