And the Hungarians tried sucking up to Hitler to try to get those territories back, especially Slovakia, but Hitler said “Nein!”
Hungary’s behavior in WW2 is quite mixed. After Hitler conquered Poland, Hungary allowed fleeing Polish troops to safely enter Hungary.
Then Hungary entered into a period of cooperation with Nazi Germany. That was partially due to a desire to regain territories lost in WW1, as you noted.
But Hungary also wanted to avoid the fate of neighboring Yugoslavia. Play ball with Hitler, or get overrun and occupied.