on (an) impulse

Definition

phrase

because you suddenly want to, although you haven’t planned to.

Example

She bought the dress on impulse, even though she didn’t need it.