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

Remove p tag since p tags cannot contain other block elements #5554

Merged
merged 1 commit into from
Feb 14, 2023

Conversation

JunichiIto
Copy link
Contributor

@JunichiIto JunichiIto commented Feb 11, 2023

Fix #5553

HTML and UI will be below:
fixed

Updated

Replaced p tag with div:
Screenshot 2023-02-14 at 8 36 24

Copy link
Member

@carlosantoniodasilva carlosantoniodasilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, good catch, I always forget the whole <p> tags can't contain other block elements thing, and the fact that button_to generates a form.

I do wonder if we should at least keep it with a wrapper like a <div>... not that I feel super strong about it, but it feels a bit weird to have loose text in there for some reason... basically what you suggested as alternative in the issue:

So it should be fixed like this:

Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?" }, method: :delete %>

or

<div>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?" }, method: :delete %></div>

I think we should do that. Would you mind amending the commit swapping the <p> with a <div>? Thanks!

@JunichiIto
Copy link
Contributor Author

@carlosantoniodasilva Thank you for your reply. I agree with you. I replaced p with div.

Copy link
Member

@carlosantoniodasilva carlosantoniodasilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

@carlosantoniodasilva carlosantoniodasilva merged commit 2d655ea into heartcombo:main Feb 14, 2023
@JunichiIto JunichiIto deleted the fix-unhappy-markup branch February 15, 2023 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Wrong markup for "Cancel my account" button
2 participants