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

Filtering styles and animation improvements #153

Merged
merged 6 commits into from
Jul 14, 2021
Merged

Conversation

tyleralsbury
Copy link
Contributor

@tyleralsbury tyleralsbury commented Jul 8, 2021

Why are these changes introduced?

A few more of the points in #100 are fixed here

  • Animation when opening/closing mobile filters
  • Checkbox styles (Excluded hover state)
  • Sorting now syncs between desktop and mobile
  • Small refactor to remove the need for any logic in the JS for the reset, clear all, and active filter remove buttons

What approach did you take?

The only thing where the approach changed significantly was the reset, clear all, and active filter buttons. They are now using a custom element so that when they re-render they automatically get their events bound instead of needing to call a function to loop and bind the events.

Demo links

Checklist

@tyleralsbury tyleralsbury changed the title Filtering - checkmark styles, synced mobile and desktop sort, refact… Filtering styles and animation improvements Jul 8, 2021
@tyleralsbury tyleralsbury marked this pull request as ready for review July 8, 2021 19:14
@tauthomas01 tauthomas01 self-requested a review July 12, 2021 13:23
@tauthomas01 tauthomas01 self-assigned this Jul 12, 2021
tauthomas01
tauthomas01 previously approved these changes Jul 12, 2021
Copy link
Contributor

@tauthomas01 tauthomas01 left a comment

Choose a reason for hiding this comment

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

Looks good, desktop and mobile.

I left one small question

sections/main-collection-product-grid.liquid Outdated Show resolved Hide resolved
assets/collection-filters-form.js Show resolved Hide resolved
@ludoboludo ludoboludo self-requested a review July 12, 2021 17:24
Copy link
Contributor

@ludoboludo ludoboludo left a comment

Choose a reason for hiding this comment

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

Works well! A few comments but some not related to this PR but the general functionality.

Also I noticed if you open a filter summary then click on the hamburger menu, they overlap: screenshot.

assets/template-collection.css Outdated Show resolved Hide resolved
sections/main-collection-product-grid.liquid Outdated Show resolved Hide resolved
sections/main-collection-product-grid.liquid Outdated Show resolved Hide resolved
sections/main-collection-product-grid.liquid Outdated Show resolved Hide resolved
sections/main-collection-product-grid.liquid Outdated Show resolved Hide resolved
sections/main-collection-product-grid.liquid Show resolved Hide resolved
@tyleralsbury
Copy link
Contributor Author

Finally got around to your comments, @ludoboludo - thanks for the review. Ready for round 2.

ludoboludo
ludoboludo previously approved these changes Jul 14, 2021
Copy link
Contributor

@ludoboludo ludoboludo left a comment

Choose a reason for hiding this comment

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

LGTM, just left one comment that can be tweaked before merging.

Comment on lines +230 to +232
.disclosure-has-popup[open] > .facets__summary::before {
z-index: 3;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should handle the click outside to close the menus with JS. And keep this CSS approach for a no JS experience.
The drawer menu doesn't seem to have a click outside closes the menu kinda thing and when using the facets__summary it could reduce the amount of clicks to open others.
But might be overkill 🤷 Just think it would like a smoother experience.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this might be too much complexity on the JS side, personally. There's also more risk of a "time-warp" sort of effect if we do it this way. Remember that when filters are changed with JS enabled, the other details elements get re-rendered. If we were to re-render an element after they've clicked the element to open it, then it will close when it re-renders.

We might be able to get around that concern by re-rendering the contents of the details element instead of the whole element, which might be one option. 🤔

We can add it to the issue as an idea and think about it.

@@ -283,7 +287,7 @@
width: 1.6rem;
height: 1.6rem;
top: 0.7rem;
left: 0.8rem;
left: 1rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

It also needs to be updated for input.mobile-facets__checkbox. When on my iPad, it looks fine on a large screen now but when it goes to the drawer I get the same thing. It's not ideal to tweak it like this as now the checkbox receiving focus isn't quite aligned with the svg but 🤷

So from what I was testing it looks like left 4.31rem is what worked to hide the default checkboxes behind the svg on mobile for iOS.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm... Ok, for now I'm gonna revert it to 0.8rem and then see if I can find some trick for iOS. I don't want the focus ring to be off-center on other browsers just cause iOS is being awkward. I'll add it to the issue and try to tackle it later.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good 👍

tauthomas01
tauthomas01 previously approved these changes Jul 14, 2021
assets/template-collection.css Outdated Show resolved Hide resolved
@tyleralsbury tyleralsbury dismissed stale reviews from tauthomas01 and ludoboludo via ac92faa July 14, 2021 17:57
Copy link
Contributor

@ludoboludo ludoboludo left a comment

Choose a reason for hiding this comment

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

🚀

@tyleralsbury tyleralsbury merged commit c6b88a5 into main Jul 14, 2021
@tyleralsbury tyleralsbury deleted the filtering-fixes-3 branch July 14, 2021 19:01
phapsidesGT pushed a commit to Gravytrain-UK/gt-shopify-dawn-theme that referenced this pull request Sep 3, 2024
* Filtering -  checkmark styles, synced mobile and desktop sort, refactor filter remove buttons
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.

3 participants