[Tex/LaTex] beamer: \only and itemize

beamerpresentations

I would like to write somethings out of the itemize environment using \only, but to do so I need to add an item before \only<2>. Does anyone know how so solve this without adding this new item?

\documentclass[t,10pt]{beamer}

\begin{document}
    \begin{frame}{Title}
        \only<1-> {
        Definition
        }
        \begin{itemize}
        % \item Useless
        \only<2> {
            \vfill \item Test 1 
         }
        \only<3> {
            \vfill \item Test 2
        }
        \vfill \end{itemize}
    \end{frame}
\end{document}

Best Answer

Simply enclose the whole itemize in another \only so it sees the first \item:

\documentclass[t,10pt]{beamer}

\begin{document}
    \begin{frame}{Title}
        \only<1-> {
        Definition
        }
        \only<2->{\begin{itemize}
        \only<2> {
            \vfill \item Test 1 
         }
        \only<3> {
            \vfill \item Test 2
        }
        \vfill \end{itemize}}
    \end{frame}
\end{document}

enter image description here