I have voted for three candidates who got arrested during their campaigns. Even though it didn't stop me from voting for them, I would have preferred they didn't do the things that led to their arrest.
First up is Michael Badnarik (L), who ran for President in 2004. He got arrested for trespassing when he showed up uninvited at a debate between George W. Bush and John Kerry. To be sure, he would have lost the election anyway, so this publicity stunt could be seen as a calculated risk or a Hail Mary play, depending on who you ask. Personally, it's not my style of campaigning because I like sleeping at home every night. But I voted for him because I was a yellow dog Libertarian at the time.
Matt Kelty (R) was arrested during his Fort Wayne mayoral run in 2007 for lying on his campaign finance forms. His perp walk was on the news. I voted for him anyway because I was mad about the proposed ballpark in downtown Fort Wayne. He lost in a landslide. After the election, he plead guilty to the felony charges but didn't have to do any time. But his status as a felon prevents him from serving in state or local elected office.
Tom Henry (D) was the one who beat Matt Kelty in 2007 and became mayor. He soundly defeated three other Republicans in 2011, 2015, and 2019. In 2022, he announced that he was running for a record fifth term as mayor of Fort Wayne. Then he got in a crash and wrecked his city-issued Chevy Impala. He had been drinking and blew a 1.5, so he was arrested for DWI. But he accepted responsibility, pled guilty to the charges, and paid for the damages. With the case behind him, Henry was re-elected, but by his lowest margin of victory in a mayor's race. It hurt him politically, but he survived the election. Sadly he died of cancer this year.
So getting charged with a crime isn't necessarily a dealbreaker for many voters, but it doesn't help a campaign either. Candidates with criminal charges should either resolve the charges before the primary or drop out of the race altogether. Serving in elected office is a privilege, not a right.