Stop Manually Trapping Focus in the HTML Dialog Element
Stop over-engineering your modals with manual focus traps. Modern accessibility standards for the HTML Dialog element have changed. By using the native showModal() method, you can provide a better user experience that allows keyboard users to interact with the browser chrome while keeping your code clean and maintenance-free.