-
Notifications
You must be signed in to change notification settings - Fork 219
Fix: Filter button is not aligned with the input field #4814
Conversation
Size Change: -17.4 kB (-1%) Total Size: 1.23 MB
ℹ️ 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.
This is looking good, thanks for working on this @dinhtungdu! There are a couple of edge cases that I think might be worth addressing in this PR if that sounds good.
If I add the block directly into a page so it occupies the entire width, would it be possible to make the input field to span almost to touch the button (only leaving a small margin between them)?
Current | Desired |
---|---|
Another case is when adding the block inside the Columns block (with three or more columns), then it's still breaking into two lines:
Current | Desired |
---|---|
@Aljullu Thanks for the head-up! I updated the PR to cover the cases you mentioned above. Please take another look! |
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.
Thanks for updating this PR @dinhtungdu! I found one last edge case:
If you add the Filter block inside a three-column block, it overflows the available space (you can see it if you make its column to have a colored background):
I spent some time trying to figure out what's going on here. It looks like min-width: 0
is ignored in inputs if their size
attribute forces them to be wider. I wonder if we could set the input size
to be something very low and then set the min-width
to 100%. I guess this way it would not overflow?
@Aljullu thanks for the catch! I fixed the issue and tested it on Chrome/Firefox/Safari. Please take another look! |
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.
Thanks for the update! This is ready to merge now.
.wc-block-attribute-filter-dropdown { | ||
flex-grow: 1; | ||
max-width: unset; | ||
width: 0; |
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.
Ah, much better and simpler fix than the one I suggested. Good catch! 👌
Fixes #2560
This PR fixes the alignment issue of the Filter Products by Attribute block when using Dropdown as the display type. This PR also fixes the height of the input field, makes it equal to the height of the filter button.
Manual Testing
How to test the changes in this Pull Request:
Performance Impact
Changelog