CHARLESTON, W.Va. — The West Virginia House has passed legislation to require the governor fill vacancies in elected state offices with someone from the same political party as the person leaving at the time.

The bill, approved 62-34 on a party-line vote, would limit the governor’s choices to three people selected by that party’s executive committee.

It was approved by the chamber’s Republicans.

It would apply to West Virginia’s three congressional seats and two U.S. Senate seats but not to vacancies on the state’s courts.

West Virginia’s House and Senate have Republican majorities. Its three congressmen and U.S. Sen. Shelley Moore Capito are Republicans.

Democratic U.S. Sen. Joe Manchin is running for re-election this year, challenged among others by Republican Attorney General Patrick Morrisey, who was re-elected in 2016 to a four-year term.