Hi,
I'm currently struggling with the situation that after creating a focus trap, it wants to focus on a certain element at the start (I use initialFocus).
This element does not always exist. In this case, I wanted to use fallbackFocus.
However, testing this case and reviewing the code I come to the conclusion that this does not work as I thought.
In getInitialFocusNode the element to focus is retrieved by let node = getNodeForOption('initialFocus'). However, getNodeForOption in the absence of such an element throws an error .... refers to no known node. In my opinion, the fallbackFocus element should be focused in this scenario, but we don't get to that point in the code. Do I understand this behaviour correctly, or perhaps it works correctly?
I can create a PR if needed, or explain in more detail.