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

Use <button type="button"> instead of <a href="#"> #208

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

kinoppyd
Copy link
Member

@kinoppyd kinoppyd commented Aug 21, 2024

In turbo frames, <a> and <button> are trigger of turbo request event if that isn't have target, specially <button> has default attribute type="submit".
If you use these element to close modal that inner element of <form> tag, useless turbo request are triggered.

To avoid these useless access, use <button type="button"> element. This is a pure button, no submit, no reset, just a button.

@kinoppyd kinoppyd merged commit 2d9da81 into main Aug 28, 2024
2 checks passed
@kinoppyd kinoppyd deleted the fixes/use_just_button_instead_of_a branch August 28, 2024 01:40
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.

1 participant