https://codepen.io/anon/pen/GPqYmM
When the Panel is opened, it focuses and opens the calendar component.
It should be up to the developer if the children in the Panel have focus. However this behaviour is only experienced if the onRenderNavigation is active.
Are you willing to submit a PR to fix? No
Requested priority: Normal
Thanks for reporting and for providing a codepen! What's happening here is that the FocusTrapZone inside the panel automatically focuses the first focusable element by default. That will be the close button with the default navigation rendering, but if you render a custom navigation without a focusable element, focus will go to the first focusable child of the panel body (in this case the date picker) instead.
There's actually a way to disable this behavior already, by setting focusTrapZoneProps.disableFirstFocus to true:
<Panel
// ...
focusTrapZoneProps={{ disableFirstFocus: true }}
>
(full example, FocusTrapZone props documentation)
Let me know if this helps!
Hey Elizabeth,
Thank you for your prompt answer!
I am closing this bug as it is a "feature" :)
Best!
Most helpful comment
Thanks for reporting and for providing a codepen! What's happening here is that the FocusTrapZone inside the panel automatically focuses the first focusable element by default. That will be the close button with the default navigation rendering, but if you render a custom navigation without a focusable element, focus will go to the first focusable child of the panel body (in this case the date picker) instead.
There's actually a way to disable this behavior already, by setting
focusTrapZoneProps.disableFirstFocusto true:(full example, FocusTrapZone props documentation)
Let me know if this helps!