Weird focus behaviour with grid

I have a dropdown with a “focusout”-Event Listener.
Inside this dropdown is a vaadin grid. When I now click on a row the focusout-Event gets triggered (as it should) but the “relatedTarget” is null.
Is this supposed to happen? I would have expected the relatedTarget to be the grid

Note that many elements can’t have focus, which is a common reason for relatedTarget to be null. relatedTarget may also be set to null for security reasons, like when tabbing in or out of a page.

But shouldnt it still focus the selected row?

or at least the grid

Focus is different from selection

The actual rules for what can receive focus can be a bit complicated, but generally speaking, you can only focus inputs

https://allyjs.io/data-tables/focusable.html

would it make sense when I checked in the focusout-Eventlistener if something in the grid is selected

I don’t think I understand the question

I have a dropdown that should close when the focus is outside it. The grid is inside the dropdown but doesnt get focus when something is selected.
Would it make sense to check the selection when the dropdown loses focus?

Hard to say. Will it help you if you check the selection?

I’m also not sure what exactly you mean with a “dropdown”

Thats fine. Your answers have already helped me, thank you