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

FP-1408: (Frontera) Fix Clickable Area of Article List Link #429

Merged

Conversation

wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented Jan 14, 2022

Overview

Make sure clickable area of article list link always opens new page.

Issues

Changes

Prevent clickable area from changing shape while link is actively being clicked i.e. during :active state.

Screenshots

FP-1408.Prod.vs.Local.mov

🆕 Bug is now not reproducible on prod (cuz of snippet-based fix) nor pre-prod (cuz the fix is now deployed).

Testing

local: setup instructions — recreating page takes too long
remote (sans fix)1: pprd.frontera-portal.tacc.utexas.edu
remote (with fix) (via build): dev.fronteraweb.tacc.utexas.edu(build,deploy)
remote (with fix) (via snippet): frontera-portal.tacc.utexas.edu(snippet)

On Frontera home page, under "User Guides" (near bottom of page):

  1. Hover over document link.
    • Document title should be underlined (solid line).
    • Outline should appear around document.
  2. Click and hold a document link.
    • Document title should be underlined (dotted line).
    • Outline should remain around document.
    • Document (whole list item and item outline) should move down by one pixel.2
  3. Release click on document link.
    • Page should open.

Notes

Breakdown of Problem & Solution

Situation
There are four list items (html <li>) on theFrontera home page. Each list item is a document with a description and a link (html <a>) (the title of the document). That link/title has a pseudo element (css a::before). That pseudo element is stretched to be the same size as the list item, so that when that list item is hovered or clicked, it triggers the link being hovered/clicked.

What is Working? What is Broken?
✓ As list item is hovered, link is hovered.
⨂ As list item is clicked, link isnotclicked.

Problem
The pseudo element (which increases the size of the clickable link) changes shape when link is clicked. Thus, wherever was clicked, after it is clicked, is not longer a clickable area. So when mouse click is released, browser does not register click in the area.

Why Does this Happen?
Upon click, offending code changes the link's position to relative(so it can move the link up or down). If link is relative, then the pseudo element stretches to fill the link (which is just the text area) instead of the whole link. Further detail requiresunderstanding CSS position: absolute and its relationship to position: relative.

Solution
Disable the offending code for article list links (untilFP-1249 changes article list markup to support the disabled code).

Footnotes

  1. 🆕 The fix got added during pprd deploy to test v3.15.0.

  2. This fix removes a (broken) feature, which is okay. The feature was that the link title would move down by one pixel on click. The whole list item (and item outline) should move down, not just the title. FP-1249 will make it all move appropriately. There is a comment for this in the changed code in this PR.

@wesleyboar wesleyboar changed the title FP-1408: Fix Clickable Area of Article List Link FP-1408: (Frontera) Fix Clickable Area of Article List Link Jan 19, 2022
Copy link
Contributor

@edmondsgarrett edmondsgarrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, works as described.

@wesleyboar wesleyboar merged commit c2cff4f into main Jan 20, 2022
@wesleyboar wesleyboar deleted the bugfix/FP-1408-frontera-home-guides-link-clickable-area branch January 20, 2022 21:08
@wesleyboar
Copy link
Member Author

This fixed was migrated to https://github.com/TACC/Core-Styles/, but just got removed in TACC/Core-Styles@53a3a6c because the other change there (new request from design) prevents the bug from ever occurring.

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 this pull request may close these issues.

None yet

2 participants