Using SLDS classes, build a modal Lightning Web Component that has focus-trapping for accessiblity.
- The shadowdom presents some challenges with creating focus-trapping within modals. Making creating a reusable component tricky. So instead we can create a modal utility file with all our methods to keep things as DRY as possible.
- This was created before the Lightning Modal component was created. The "out of the box" Lightning Modal contains focus trapping, so I'd recommend using that over this implmentation. However, you can still use code for "modal-like" custom elements that may require focus trapping. For example, a slide out navigation that covers the page content could be considered a modal and should therefore have focus-trapping when open.