Nice job, I tried to go through your solution using keyboard and it works fine, the only one thing i noticed is that if dropdown menu is open, focus still can go out of it. I had the same issue and solved it using quite new html property "inert". Check it here: https://caniuse.com/mdn-api_htmlelement_inert
Marked as helpful