Skip to content
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

Clear filters anchor not visible (font size inherited to be 0) #274

Closed
1 task done
commitBlob opened this issue Oct 19, 2021 · 2 comments · Fixed by #276
Closed
1 task done

Clear filters anchor not visible (font size inherited to be 0) #274

commitBlob opened this issue Oct 19, 2021 · 2 comments · Fixed by #276

Comments

@commitBlob
Copy link

commitBlob commented Oct 19, 2021

Prerequisites

  • Put an X between the brackets on this line if you have done all of the following:
    • Reproduced the problem
    • Followed all applicable steps in the debugging guide
    • Checked the FAQs on the message board for common solutions
    • Checked that your issue doesn't exist: https://github.com/ministryofjustice/moj-frontend/issues
    • Checked that there is not already a package that provides the described functionality

Description

Clear filters anchor is not visible as font-size is inherited from the moj-filter__selected-heading class where font-size: 0;. As anchor is wrapped with the paragraph tag it inherits font size from the parent.

Steps to Reproduce

  1. Navigate to filter component MoJ Pattern Library

Expected behaviour:
Expected to see Clear filters anchor right of the Selected Filter header

Actual behaviour:
Clear filter anchor is not visible on the page

Reproduces how often:
100%

Versions

Was able to replicate the issue on the MoJ Pattern Library website as well as locally.

Local settings:
OS Version - Windows 10 Enterprise 21H1
Chrome - Version 94.0.4606.81 (Official Build) (64-bit)
@ministryofjustice/frontend package - 0.2.6
Node.js - v14.17.0

Additional Information

Adding a class such as govuk-body to the paragraph wrapping the anchor tag displayed element successfully.

Currently
with class

@gregtyler
Copy link
Contributor

Thanks @commitBlob, good spot! I think a slightly cleaner fix would be to add govuk-!-font-size-19 to the <a> element, since govuk-body also adds a margin, which could have a negative effect elsewhere. I'll try and get that done today :)

gregtyler added a commit that referenced this issue Oct 22, 2021
The parent `font-size:0` rule was cascading to the clear link, meaning it wasn't shown. By adding an
explicit font size to it, we can ensure it is shown.

fix #274
gregtyler added a commit that referenced this issue Oct 22, 2021
The parent `font-size:0` rule was cascading to the clear link, meaning it wasn't shown. By adding an
explicit font size to it, we can ensure it is shown.

BREAKING CHANGE: Clear links will now be shown on Filter components.

fix #274
@commitBlob
Copy link
Author

Thanks Greg, agreed setting font size seems like a cleaner fix.
Looking forward to a new release

gregtyler added a commit that referenced this issue Oct 26, 2021
The parent `font-size:0` rule was cascading to the clear link, meaning it wasn't shown. By adding an
explicit font size to it, we can ensure it is shown.

BREAKING CHANGE: Clear links will now be shown on Filter components.

fix #274
gregtyler pushed a commit that referenced this issue Oct 26, 2021
# [1.0.0](v0.2.6-alpha...v1.0.0-alpha) (2021-10-26)

### Bug Fixes

* **filter:** ensure the clear link is shown ([4c23cbd](4c23cbd)), closes [#274](#274)

### BREAKING CHANGES

* **filter:** Clear links will now be shown on Filter components.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants