-
Notifications
You must be signed in to change notification settings - Fork 313
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
Add Date Filter #3700
Add Date Filter #3700
Conversation
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.
@burhandodhy I gave it a quick look and overall it looks good, just added a few comments. Let's also ask @JakePT to give it a look.
|
||
<?php if ( $this->display_custom_date ) : ?> | ||
<li> | ||
<a aria-label="Apply filter: <?php esc_html_e( 'Custom', 'elasticpress' ); ?>" href="#" rel="nofollow" class="ep-date-range-custom <?php echo $is_custom_date ? 'checked' : ''; ?>"> |
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 will need some changes for accessibility, only when the filter is not applied:
- Add
role="button"
- Add an
aria-expanded
attribute that changes when the date form is shown. - Change the aria-label to something like "Select date range".
When it is already applied it should just be a link and the label should read "Remove filter", like the checkbox filters.
3046fb9
to
bc50521
Compare
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.
@burhandodhy I gave this a try and if I uncheck the "Display custom date option" and save, the block doesn't seem to work anymore. (I see a Cannot read properties of null (reading 'classList')
error in the console.)
Description of the Change
This PR adds a new Filter block that is the "Date Filter"
Closes #3634
How to test the Change
Changelog Entry
Credits
Props @burhandodhy
Checklist: