rcpch / digital-growth-charts-react-component-library

A typescript React library for displaying RCPCH Digital Growth Charts from API data
https://growth.rcpch.ac.uk
MIT License
8 stars 11 forks source link

radiobutton-dynamic-naming #87

Closed eatyourpeas closed 5 months ago

eatyourpeas commented 5 months ago

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

Related Issues

closes #85

Mentions

Many thanks to @dmc-cambric for picking this up and ongoing support for the project.