Within Manipulate, I want to vanish certain controls if other controls satisfy a specific condition. The simplest case is to consider two checkboxes, x and y, where y vanishes if x is selected.
I have heard of the vanishing function ## &[] or Unevaluated[Sequence[]] (from this question), but it doesn't seem to do what I want. Consider the following code
Manipulate[x,
Control[{{x, 0}, {1, 0}}],
Dynamic@If[x == 0, Control[{{y, 0}, {1, 0}}], ## &[]]]
which yields
What I want is
but I'm getting
Surprisingly enough, using Grid in the following manner solves my problem
Manipulate[x, Dynamic@Grid[{
{"", Control[{{x, 0}, {1, 0}}]},
If[x == 0, {"", Control[{{y, 0}, {1, 0}}]}, ## &[]]}]]
Any idea why? How do I fix my code?





Ifin the code, making it slightly shorter. – sam wolfe Mar 18 '20 at 21:31## &[]within theGridyou don't get the spacing. I wonder what's happening internally in Mathematica. – sam wolfe Mar 18 '20 at 21:41Manipulateexpression usingGrid, I get exactly the same result as your first example withoutGrid. – m_goldberg Mar 18 '20 at 21:55ManipulatewithGrid. Please check it now. – sam wolfe Mar 19 '20 at 00:15