Should both H4 and H4 EAD always be based on principal H1B's same employer?

Suppose someone is on h4 (no h4 ead) with h1b employer A…

Now h1b spouse changes to employer to B. Now I know h4 visa linked to employer A is still valid. If h4 spouse wants to get EAD now it would be based on h1b approval of employer B.

This way can h4 spouse have her h4 based on employer A and h4 ead based on employer B or they need to port h4 also to employer B? Thx