As of the last hotfix (22.3.5) using any melee attack brings you out of sprint similar to how aiming or firing a weapon would. Not really sure if this is intentional as it doesn't appear to be documented.