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

Move clear link outside of Faceted Search navigation button #1755

Conversation

mattcoy-arcticleaf
Copy link
Contributor

What?

The current HTML markup for the link to clear faceted search element's items is invalid as it is located inside a button. This update moves the clear link outside the navigation button, so it no longer violates W3C markup standards (see below for a screenshot of the error message). This update also adds padding so the title of the filter does not overlap with the clear button.

Additionally, this update componentizes the faceted search navigation. Previously, the faceted search navigation code was repeated in the exact same code across 3 different templates.

Lastly, this update cleans up some extraneous whitespace (for consistency with the rest of the codebase) and otherwise questionable code.

The only visible change to the theme is, as stated above, the padding adjustment to prevent the overlap of the faceted search filter title and the clear button.

Tickets / Documentation

N/A

Screenshots (if appropriate)

W3C Validator error message

- Componentize navigation
- Remove some extraneous whitespace
- Remove unneeded “../“
- Remove unneeded Replace helper
- Move “Remove” link outside button
@bigbot
Copy link

bigbot commented Jul 30, 2020

Autotagging @bigcommerce/storefront-team @davidchin

@junedkazi
Copy link
Contributor

@bigcommerce/artemis-dt

@@ -46,7 +27,7 @@ <h5 class="accordion-title">
</ul>

{{#if show_more_toggle}}
<a href="#facetedSearch-navList--{{#replace '&' (hyphenate facet) }}{{else}}{{hyphenate facet}}{{/replace}}" role="button" class="toggleLink">
<a href="#facetedSearch-navList--{{dashcase facet}}" role="button" class="toggleLink">
Copy link
Contributor

Choose a reason for hiding this comment

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

@lord2800 will this break things for facets which have & ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@junedkazi , Nope! IMO, dashcase is the correct helper to use here as it strips special characters and converts everything into a nice, usable form.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I wish I'd found that when we were initially looking into that problem. 😢

@junedkazi
Copy link
Contributor

@mattcoy-arcticleaf this is good to go. We need to hold off on merge because we are in the process of doing a release. As soon as that is rolled out we will merge this one.

@mattcoy-arcticleaf
Copy link
Contributor Author

@junedkazi no worries. Do you want me to make a changelog entry?

@junedkazi junedkazi merged commit 35cecbc into bigcommerce:master Aug 25, 2020
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