I got an fat tire ebike. My non shock front fork bent on it so i replaced it with a fork that had shocks on it. Installed it all good and even ordered a new top cap (fork needed the top cap installed too) put everything together and tighted the top cap, straightened the headset and lined it up. Tightened all the bolts and took it for a test drive. First thing i noticed the handlebars kept on wanting to sway left and right. When i pick up speed the bike doesnt want to ride straight. Feels like walking a strong dog that just pulls you. Just doesnt feel balance no matter how much i adjust the headaet.
One of two possible differences can explain the issue.
The most likely is that putting in the new fork affected the handling geometry. For example, if your old fork was non-suspension fork, it could be that the axle-to-crown distance is short. If you put a new fork with more axle-to-crown distance, the front end of the bike rises. Also forks may have differing amounts of rake. These two differences, difference in rake or difference in axle-to-crown distance could affect the handling of the bike.
A second possibility is if you have a Surly Pugsley, one of the earliest fatbikes (unlikely). It has an off-center rear wheel. They decided specifically to make front and rear wheel interchangeable so the front wheel too has the same 135mm over locknut distance and also the same offset built into it. If you put a non-asymmetric fork in there, it could mean the front tire is no longer centered in the frame due to new fork being non-asymmetric, meaning the bike doesn't want to go straight. However, this is a very unlikely case because you would need to find a non-asymmetric 135mm wide front fork -- where would you find one?