-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Conversation
…r filter remove buttons
There was a problem hiding this 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
There was a problem hiding this 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.
Finally got around to your comments, @ludoboludo - thanks for the review. Ready for round 2. |
There was a problem hiding this 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.
.disclosure-has-popup[open] > .facets__summary::before { | ||
z-index: 3; | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
assets/template-collection.css
Outdated
@@ -283,7 +287,7 @@ | |||
width: 1.6rem; | |||
height: 1.6rem; | |||
top: 0.7rem; | |||
left: 0.8rem; | |||
left: 1rem; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍
ac92faa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
* Filtering - checkmark styles, synced mobile and desktop sort, refactor filter remove buttons
Why are these changes introduced?
A few more of the points in #100 are fixed here
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