pass the correct element when trapping links