"They drink tea and chat at the same time."
I think it’s ok if you come from the English sentence. But be aware that usually the first action is interpreted as the background for the second one. So your sentence would correspond to English “They drink tea while chatting” while the model translation would be “They chat while drinking tea”. In this case there isn’t much difference but in context one order is often preferred over the other.
It's not about extra spaces, it's about any spaces.
I don't know what's wrong with your keyboard, or if it's user error, but I've never heard anyone else mention this supposed bug in MacOS. It shouldn't happen on any keyboard.
In Chinese the spacing is built into the punctuation; there shouldn't be a space added after it, by you or by your keyboard. In fact there should be no independent spaces at all, so don't hit the space bar at all after typing a comma. If your "keyboard" inserts a space anyway, then you'll have to delete the space in order to enter the correct Chinese.
Your sentence (which I've copied from your comment and pasted on the first line below) is followed by the correct sentence (Duolingo's, copied and pasted from the top of this page). Look at the spacing difference.