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

radiobutton-dynamic-naming #87

Merged
merged 5 commits into from
Jun 15, 2024
Merged

radiobutton-dynamic-naming #87

merged 5 commits into from
Jun 15, 2024

Conversation

eatyourpeas
Copy link
Member

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 the id and the name of each radiobutton input for the life of the component.
  • StyledResetZoomButton - passes the margin prop through to the component from makeAllStyles. sets the border-radius to 0 as button showing as rounded in storybook
  • rename the callback from the radiobutton group from handleClick (which is used elsewhere) to more meaningful name
  • bug fix for tanner2 them which had been duplicated with tanner1 in error. Returns the theme to the orginal tanner2 styles
  • package.json bumps the version as a patch

Related Issues

closes #85

Mentions

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

@eatyourpeas eatyourpeas self-assigned this Jun 15, 2024
@eatyourpeas eatyourpeas merged commit 637e26a into live Jun 15, 2024
1 check passed
@eatyourpeas eatyourpeas deleted the id-rename branch June 15, 2024 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Age buttons don't work independently when multiple charts are on screen
1 participant