-
Notifications
You must be signed in to change notification settings - Fork 219
Style the Filter by Price block based on the wrapper width #6943
Conversation
The release ZIP for this PR is accessible via:
|
Size Change: +707 B (0%) Total Size: 868 kB
ℹ️ View Unchanged
|
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! 🚀
Everything tests as described. In addition, I tested different column container widths and everything works as expected across the board.
It would be nice if we could shift the layout with a media query in CSS so we wouldn't have to calculate the wrapper width to set the positioning of the price input fields.
For example, if the input fields are rendered on the same row as the slider bar, they will remain on that row even as the viewport changes in size.
That being said, this is a very nice improvement and if the above route is even a plausible option, it could be considered in a follow-up.
Nice work!
@danielwrobert AFAIK, we can't use media query for this because it attaches to the window width. For example, the sidebar can be very narrow on a portrait tablet and we can't detect it using
I noticed this too. We can fix this by listening to the browser |
@dinhtungdu yeah, I see what you're saying. That's a great point!
Yeah, I agree. I think you made the right call here. I approved this PR so my notes weren't meant to be blocking. Great work on this! |
Fixes #6942
This PR calculates the wrapper width on render, then use that width to control the inline layout of the price silder.
300px
, theInline input fields
is forced disabled.Inline input fields
is enabled or the wrapper width ≤300px
, the input field width is always set to60px
.These additional conditions make the price slider works as expected with any screen size.
Accessibility
prefers-reduced-motion
Other Checks
Screenshots
Testing
Automated Tests
User Facing Testing
300px
.300px
.WooCommerce Visibility
Performance Impact
N/a
Changelog
N/a