-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Change clear filter button from text to icon #8205
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
base: development
Are you sure you want to change the base?
Change clear filter button from text to icon #8205
Conversation
| <FontAwesomeIcon | ||
| v-if="searchFilterValueChanged" | ||
| class="navIcon clearFilterIcon" | ||
| :title="$t('Search Filters.Clear Filters')" | ||
| :icon="['fas', 'filter-circle-xmark']" | ||
| role="button" | ||
| tabindex="0" | ||
| @click="clearFilters" | ||
| /> |
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.
Please wrap this icon in a button with no border and a transparent background colour and apply the event listeners and title etc to the button, as they are much more screen reader friendly (e.g. you forgot to add keyboard event handlers here, so it would only be usable for people with a mouse, but buttons do that automatically) and "interactive icons" won't work once we upgrade to FontAwesome 7.
I'm working on doing that for the rest of the "interactive icons" in FreeTube, so please do that here too (would be best if we don't introduce new code that has to be fixed straight away).
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.
Sure, do you have an example of which button component to use? I looked through the code and saw <button>, <ft-button>, <ft-icon-button> so not sure which (if any) of these to use. Thanks
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.
The standard HTML <button> element: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button
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, I've wrapped the icon now and also removed the hover CSS since it relied on the background color
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.
You can still have hover styling, the transparent background is just so it doesn't get the default button background which is grey, but overriding it to something else on hover is fine.
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.
Okay cool, wasn't sure about that but I've re-added it
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Co-authored-by: PikachuEXE <git@pikachuexe.net>
Head branch was pushed to by a user without write access
Pull Request Type
Related issue
As discussed in PR #7531
Description
Changes the "Clear Filter" button with a text label to a button with an icon. It also moves the position of the button and will not show the button unless one or more filter(s) are applied.
Screenshots
Before

After

Testing
Open the Search Filter window
See that the filter button is not visible since no filters are selected
Select one or more filters
See that the Clear Filter icon is now visible
Click the Clear Filter icon to remove all current filters and confirm the icon disappears