I'm having some trouble with spoilers.

Sometimes they open fine...but sometimes they just open and close, open and close, open and close.
It's really strange.

I'm not really sure what is making them do this, any solutions?