When using the default sprint key, CTRL, on a OSX device, you are not able to attack.
This is caused because CTRL+click on mac simulates a right click, again disabling the use of left click while ctrl is held down.
Different keys could be used for sprint, but I find ctrl is the most convenient and easiest to use.
I suggest adding some way to toggle the "ctrl-click = right click" on the in-game or launcher settings to resolve this issue.
This is not a duplicate of MC-13695, only related. Can't there be an option to disable right click emulation using ctrl? It's a real pain that all left clicks become right clicks when holding down ctrl to sprint. Still there in 1.10.