-
Notifications
You must be signed in to change notification settings - Fork 109
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
Rework clickable cards using CSS invisible overlay rather than JS event handler #762
Conversation
packages/components/card/card.scss
Outdated
color: $nhsuk-focus-text-color; | ||
} | ||
.nhsuk-card__heading a, | ||
.nhsuk-card__link { |
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.
@chrimesdev I've put both these selectors in here in order to be consistent with what came before. Is this still necessary? I assume it's backwards compatibility before the .nhsuk-card__link
class was added
@Fenwick17 as you did the original work with the clickable Card, are you OK to take a look at this? I'll also give it a review |
Spotted one issue that occurs with MacOS Hover Text. Everything else appears to be working as you would expect. |
Thanks @Fenwick17 - do you mean these ones? |
Sorry, I see what you mean now. Using https://support.apple.com/en-gb/guide/mac-help/mchlb203bc78/mac Let me have a think about this 🤔 |
Added a gif of the issue, if it can't be resolved we will have to make a decision on whether it is acceptable as it is. I believe NVDA with mouseover will also not read the body content due to the overlay, but I haven't tested that yet. |
yeah makes sense. I'm on windows so I'll see if there's anything similar here. And will have a think if there's anything sensible can be done |
@chrimesdev @Fenwick17 I'm not sure what to do about this. Surely anything that alters what HoverText "sees" would also affect what a screenreader sees. So if we start changing things for HoverText, we would negatively affect other tools. I don't know if a perfect solution exists for this then. I think we're stuck choosing between two slightly imperfect solutions:
Any thoughts? Have I missed any other options? |
I just performed some Browserstack testing and didn't spot any issues with the CSS only solution. For both of these I personally don't think they are show stoppers. The only thing that comes to mind at the moment is if we add visually hidden content to the link itself, so that it will show up with Hover Text.
Then you would have to use What do you think? Overall, I think we can proceed with what Andy has done. |
@Fenwick17 as you have done more work on this than I have, I am happy to go with what you think is best. |
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.
Happy to move forward with this implementation
@andymantell do you think this needs a little more information in the |
@chrimesdev Agreed. Done - moved it to 6.0.0 and added a note about removing JS |
Thanks Andy, as this is a breaking change we will hold off merging this PR and merge/release with #740 |
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.
Reviewed and approved. ready for v7.0.0 of frontend library, date for this is unconfirmed
Tabs tests - Initial dom setup
# Conflicts: # CHANGELOG.md # packages/components/card/card.js # packages/components/card/card.scss # packages/nhsuk.js
Description
Rework clickable cards using CSS invisible overlay rather than JS event handler
This avoids problems with using Ctrl-click, middle click, right click to open new tabs since the link just behaves as it would natively
Fixes #758
Fixes #749
Checklist
Issues observed during browser testing
IE10 - image is not clickable in "card with an image" example. Ignoring, because IE10 is not supported and the experience is ok.Fixed. Don't know whether we want IE10 fixes lingering around, but it's relatively inoffensive, so might not hurt to have it for a while? Easily removed if we don't want it...