Skip to content

Adjust the tooltip arrow and fix tooltip fading on Safari#34

Open
wr2f25 wants to merge 3 commits intoeprints:masterfrom
wr2f25:improve-tooltips
Open

Adjust the tooltip arrow and fix tooltip fading on Safari#34
wr2f25 wants to merge 3 commits intoeprints:masterfrom
wr2f25:improve-tooltips

Conversation

@wr2f25
Copy link

@wr2f25 wr2f25 commented Aug 14, 2025

The arrow above the ORCID tooltip (when you hover over 'iD') was adjusted in 21bae97 to make it consistent across browsers however it also shifted it well away from the button itself (see this comment), so this moves it back while ensuring it still works across Chrome, Firefox, Safari and Edge.

When you hover over the 'iD' button there is a 0.3s opacity transition to fade the tooltip in however on Safari this wouldn't fade the text, instead that would appear jarringly at the end of the transition. This appears to be a quirk of how setting visibility interacts with transition opacity on text so to fix it I removed the visibility setting in favour of pointer-events: none (and user-select: none to prevent accidental copy-pasting).

As a final fix this also prevents the 'iD' icon from being selected as otherwise when you copy a row of authors it adds a bunch of [ORCID logo] strings to the copied text.

@wr2f25 wr2f25 changed the title Adjust the tooltip arrow and fix its fade on Safari Adjust the tooltip arrow and fix tooltip fading on Safari Aug 14, 2025
wr2f25 added 3 commits August 14, 2025 10:09
Previously the opacity transition on Safari would correctly fade the
background however the text would just _appear_ at the end of the
transition. This appears to be some quirk of setting visibility where
the text doesn't adjust the visibility until the end of its transition.

To fix this it doesn't ever set itself invisible and just only
transitions into `hover` rather than transitioning both ways. However
this causes an issue where they are always selectable (hanging below
their name) and when you hover below the name the orcid pops up. But
there is no reason to be able to select the orcid-tooltip (as you select
the icon to open it) so it just disables `pointer-events`.
The positioning of the arrow was adjusted in 21bae97 to make it
cross-browser consistent however this shifted it a long way away from
the item being pointed to. This re-adjusts it so that the arrow points
directly at the 'iD' icon and appears to work identically across Chrome,
Firefox, Safari and Edge.
As a quirk of removing `visibility: hidden` the tooltip text would now
be copied if you just try to select all of the names associated with an
EPrint. To solve this we have to set `user-select` (and its tagged
versions).

In a similar vein you now also can't select the 'iD' icon as this would
previously add '[ORCID logo]' to the copy-pasted text.
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.

1 participant

Comments