<script
src="https://cdn.jsdelivr.net/gh/hchiam/[email protected]/keyboard-focus-trap.js"
integrity="sha384-X4CXOjFm0n6iwt8qEFOvwsXLyZonS799Q47YRuZPFQOTUHXkGlV9kXsbjpZ1S3rm"
crossorigin="anonymous"
></script>
bash get-integrity.sh
https://stackoverflow.com/questions/44452084/how-to-keep-focus-within-modal-dialog/44481275#44481275
May not work well with web components and shadow DOM, but can be overcome with custom code.