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

Make DetailsTooltip buttons type="button" #115

Open
acharb opened this issue Apr 8, 2022 · 4 comments
Open

Make DetailsTooltip buttons type="button" #115

acharb opened this issue Apr 8, 2022 · 4 comments

Comments

@acharb
Copy link

acharb commented Apr 8, 2022

If the DetailsTooltip is in a form currently it submits the form on click

@acharb acharb changed the title Make tooltip buttons type="button" Make DetailsTooltip buttons type="button" Apr 8, 2022
@quietbits
Copy link
Contributor

@acharb Could you please provide a code example of where this issue is happening? I'm assuming it's on forms that have onSubmit on the form, correct?

@acharb
Copy link
Author

acharb commented Apr 12, 2022

yup! For example here: https://github.com/stellar/freighter/pull/432/files#diff-40870d652ae0f03471886bc3aead9e4e9ad2a3440905e85d881f79aa1b90d283R106-R118
(RadioCheck contains a DetailsTooltip, which submits the form)

@piyalbasu
Copy link
Contributor

I believe if you just give the button type=button it will prevent it from submitting

@quietbits
Copy link
Contributor

Thanks for the details. I just wanted to confirm that I understood the issue correctly. It looks like browsers usually have the default type for buttons submit, that's why this is happening.

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

No branches or pull requests

3 participants