Brexit is a factor, but it is by no means the entire cause of the shortage.
Covid, and the need to quarantine when returning to the UK is another.
Also HMRC has recently changed the way that self employed and agency drivers are taxed (so called IR35), which has meant that many foreign drivers may have decided to ply their trade elsewhere.