When I added details elements as direct childs of an element with popover attribute on, I faced a problem with keyboard interactions. I can easily tab through all my focusable content inside the popover, but when it comes to the first details I can trigger it with keyboard, but cannot tab any further. So I end up with some focusable elements being unreachable with keybord.
This is very simple example for demo purposes:
<button popovertarget="popover">Open popover</button>
<div id="popover" popover>
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<button>Button 1</button>
<button>Button 2</button>
<button>Button 3</button>
<details>
<summary>First summary</summary>
<p>First paragraph</p>
</details>
<button>Button 4</button>
<details>
<summary>Second summary</summary>
<p>Second paragraph</p>
</details>
<details>
<summary>Third summary</summary>
<p>Third paragraph</p>
</details>
<details>
<summary>Forth summary</summary>
<p>Forth paragraph</p>
</details>
</div>
Surprisingly the problem doesn't occur when details are put inside the dialog. Of course outside modals it doesn't occur neither. I cannot understand what causes the problem with popover. Do I have to use dialog for this instead? I think my use case doesn't fit well the semantics of dialog.