I don't know on keyboard, but on gamepad you don't auto-attack when you're targeting stuff, even if you press X or A button to confirm the target. You must press X or A twice to start auto-attacking, or press an attacking skill to start the auto-attack.

Maybe there's something similar on keyboard.