In the following example, I have a hyperlink that only appears after a \pause, or on \onslide, etc. However, the clickable hyperlink region is active even when the hyperlink text itself is hidden (i.e. we can click the empty region where the hyperlink text will appear even on the very first slide). I would like the hyperlink only to be clickable when it is visible. I also do not want to have to manually annotate hyperlinks with the slide on which they should appear, e.g. explicitly writing <2>. Is this possible?
\documentclass{beamer}
\begin{document}
\begin{frame}{First frame}
The hyperlink only appears...
\onslide<2->{...after a pause. Then we can click \ref{def}.} This text...
...and this text should always be visible.
\end{frame}
\begin{frame}{Second frame}
\begin{definition}
\label{def}
Here is a definition.
\end{definition}
\end{frame}
\end{document}
A screenshot of the issue (the pointer is over the hyperlink region):

\only. I'll update my example. – varkor Jun 14 '23 at 11:09\altto add dummy space instead – samcarter_is_at_topanswers.xyz Jun 14 '23 at 11:10\onslide, so that this method works also for the updated example in the question? – varkor Jun 14 '23 at 11:14\alt<.->should be easier. – samcarter_is_at_topanswers.xyz Jun 14 '23 at 11:17\onslide<2->{...after a pause. Then we can click \alt<.->{\ref{def}}{\phantom{\ref{def}}}.}, the hyperlink is still present (it's not with\alt<2->). Did I misunderstand what you meant? – varkor Jun 14 '23 at 11:21\newcommand{\bref}[1]{\alt<-.>{\phantom{\ref{#1}}}{\ref{#1}}}to make things more readable. I also realised my question really refers to\visiblerather than\uncover, because in the latter case the hyperlinked text is still visible with\setbeamercovered{transparent}. – varkor Nov 07 '23 at 23:53