According to Star Wars and other questions (In-universe, how is BB-8's head adhered to his body?), BB-8's head is attached magnetically to his body.
That's fine and all, but, in Episode VIII, when Poe is attacking the Dreadnought and BB-8 is fixing the X-wing’s guns, he headbutts the control panel, extending some form of neck.
What is this? If it is a random extension arm (like his blowtorch), why doesn’t his head just fall into the ground when pushed away from his body?