Your popovers on the Balai’s board open from popovertarget: click outside, press Esc, put them inside a box that clips its overflow, and see which stay open…
Why it matters
A proper popup is hard: z-index wars, clipped by overflow, forgetting to close on a click outside, focus going astray. The Popover API sorts it out in the browser: the top layer, light dismiss, Esc, a stack of nested menus, and the toggle event. Without one line of JS.
The key idea
An open popover lives in the top layer, and auto closes itself
Common mistakes
Taking an auto popover for a modal like a dialog A popover is non-modal: the page behind still takes clicks and focus (try the Konfirmasi situation). For a question that must be answered first, use <dialog> with showModal().
A manual popover stuck openmanual has no light dismiss. Give it a popovertargetaction="hide" button inside, or call hidePopover() from JS.
Putting a high z-index on a popover No need: an open popover is in the top layer, above everything and never clipped by overflow. Conversely, z-index: 9999 on an ordinary dropdown cannot escape its ancestor’s overflow: hidden.
Try it in this playground
Open the menu, then click outside The menu closes by itself. The log names the cause: light dismiss.
Open the menu, then press Esc Esc closes the topmost auto popover.
Click the button behind while a popover is open The popover closes, yet your click still reaches the button (see its count). A popover is non-modal, unlike showModal().
Open the nested submenu: Menu then Lainnya Both stay open: the auto stack holds two popovers.