The lift providing foil is mounted at the bottom of what is effectively a dagger. The foil and the part of the dagger that's not been lifted out of the water, together with the rudder itself provide enough drag to prevent downwind drift. It's possible that at maximum lift, the foiled dinghies experience a bit more drift but that they make up for this in speed. Some designs may also have a dagger extension below the foil, to further reduce drift.
Most (decent) windsurf boards have daggers too (even retractable ones, like in traditional racing dinghies).
Some catamarans have daggers but others have twin, sharp hulls that provide deceptively much resistance to downwind drag because although they don't penetrate deeply into the water their length combined with that shallow depth provides comparable surface area to a traditional dagger.
A few extra considerations re. the need for a dagger:
We can distinguish three main courses:
1. Close to the wind:
A decent dinghy can sail a course close to the wind of about 45 degrees. It is almost sailing in the opposite direction of the wind. This is generally the slowest course and one where most dagger is needed. Racers will have the dagger pushed in to the lowest position.
2. Half wind:
At an angle of 90 degrees speed is generally highest and less dagger is needed. Racers will typically push the dagger in about half way down. This is also the course where a foiled dinghy will experience most lift.
3. Wind from behind:
With the wind from behind there is no need for dagger, as drift coincides with the direction of sailing. Racers will lift the dagger to its highest position. Speed is typically between both courses mentioned above.