Upon opening the dialog, the browser appears to believe that
<embeddedservice-chat-header>
is in focus. This can be confirmed by running the command
document.activeElement
in the console panel of the code inspector. As you navigate through the dialog using the tab key and check
document.activeElement
after each tab, the focus shifts to the "welcome"
<div>
(for what reason?), followed by the three
<input>
elements, the "by submitting"
<label>
(once more, why?), and finally the "start chat"
<button>
.
(It's worth noting that the <div>
and <label>
elements are not interactive elements, which raises the question as to why the focus moves to them.)
Continuing to navigate via tabbing brings the focus back to the top of the dialog—first to the minimize button, then to the close button. Strangely, instead of the actual <button>
elements receiving focus, it's the
<embeddedservice-chat-header>
that captures the attention. This suggests that there may be some pre-programmed JavaScript within the custom
<embeddedservice-chat-header>
element that redirects focus to an internal component.