Charging electronic devices in car

If I am charging my phone, or iPad, or some other device in my car with a plug - in charger, and stop at a store, is it better to unplug the charger before I turn the car off, or doesn’t it matter? I’ve heard that it’s not good for the battery of the charged item to be plugged in while I turn the car off and on, and I’ve heard it makes no difference, and I haven’t got the foggiest which one is correct.

the charger will have a regulated DC-DC power supply anyway to get the 5 volts the device needs, so the device should be quite safe. further, i think a lot of power points in modern cars are switched with the key anyway.

First off, the battery in the car has way more energy to continue charging with the engine turned off when it comes to such small devices and short stops. And the voltage is more stable at about 12.6VDC when the engine is off then when running when the voltage is up to 14.5VDC and fluctuating.

Bottom line: Do the easiest thing and leave it plugged in and charging.