The button to exit the shop is “L”, not “B” actually.
Sorry that's if you're using a controller - I should switch it if you're not