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.
Overview
A bug first identified by @dmc-cambric that when two `<RCPCHChart key={'1'} {...props}/> components are rendered side by side, the radiobuttons toggling between chronological/corrected/both ages were clashing - selecting the buttons would update the state and refresh the plot, but would deselect the radio button in the other component.
This was because the
name
attribute in the radiobutton group was clashing in the DOM with the other instance.Alongside the fix for this, opportunistically a few small changes were also made.
Code changes
AgeRadioButtonGroup.tsx
introduces a randomly generated string appended to theid
and thename
of each radiobuttoninput
for the life of the component.StyledResetZoomButton
- passes themargin
prop through to the component frommakeAllStyles
. sets the border-radius to 0 as button showing as rounded in storybookhandleClick
(which is used elsewhere) to more meaningful namepackage.json
bumps the version as a patchRelated Issues
closes #85
Mentions
Many thanks to @dmc-cambric for picking this up and ongoing support for the project.