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
7 stars 9 forks source link

React buttons default to type submit and will submit html form #88

Closed ryanlewis94 closed 2 months ago

ryanlewis94 commented 2 months ago

Our current implementation uses a form whereby users can submit patients details and save them by submitting a form. I have noticed that when clicking any of the buttons on react component it will attempt to submit our form. I believe this is because in React if you do not specify a type, then the buttons default type is submit. If possible can the buttons specify type button so we do not get this issue?

mbarton commented 2 months ago

Thanks for reporting @ryanlewis94 - I think this should be a straightforward change. Let me look into it

mbarton commented 2 months ago

Sorry for the delay on this one @ryanlewis94, we've now released a fix in v7.0.5:

ryanlewis94 commented 2 months ago

@mbarton it looks like gradient-labels-button does not specify a type and therefore is still causing the issue image

mbarton commented 2 months ago

Hmm yeah sorry about that - I thought I had covered off all the buttons. I'll have a look now

mbarton commented 2 months ago

@ryanlewis94 I've released v7.0.6 which fixes the gradient labels button too