Yes, that counts as fighter B's attack that turn. Unless it's a unit that has multiple attacks (DropShip, it used the rear ability and split its fire, etc), then it's done with its attack that combat phase.
If fighter B wants to attack a different unit, it must ("save its action") decline to attack fighter A during that engagement.