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

fix: use spans inside button tag instead of divs #994

Merged
merged 2 commits into from
Feb 2, 2021

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Feb 1, 2021

Summary

At the moment there is the following HTML issue related to the incorrect use of the button tag:

Element “div” not allowed as child of element “button” in this context. (Suppressing further errors from this subtree.)

I suggest replacing the button with a regular div element.

Result

According to the validator (https://validator.w3.org/nu/#textarea), the error has been fixed.

cc @francoischalifour

{...props}
ref={ref}
>
<div className="DocSearch DocSearch-Button" {...props} ref={ref}>
<div className="DocSearch-Button-Container">
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be moved to a span instead and the button stays (I think)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we are more and more confident with this button tag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, it makes sense, replaced divs with spans.

@lex111 lex111 changed the title fix: avoid misuse button tag fix: use spans inside button tag instead of divs Feb 1, 2021
Copy link
Contributor

@Shipow Shipow left a comment

Choose a reason for hiding this comment

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

Thanks a lot Alexey and Haroen!

Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

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

this looks like a solid fix, thanks!

Copy link
Member

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

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

Thank you @lex111!

@francoischalifour francoischalifour merged commit f5c2a27 into algolia:next Feb 2, 2021
@francoischalifour
Copy link
Member

Released in @docsearch/[email protected].

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.

4 participants