Issue summary
If a Modal has a primary action with disabled: true, focus isn't trapped in the modal when tabbing over focusable elements.
Expected behavior
Focus wraps around to the first focusable element inside the Modal when tabbing away from the last focusable element.
Actual behavior
User can tab out of the Modal if the primary action is disabled.
https://screenshot.click/polaris-modal-broken-focus-trap.mp4
Steps to reproduce the problem
- Create a Modal dialog with a disabled primary action
- Open the modal. Focus should automatically move to the first focusable item within the modal.
- Start hitting the Tab key on your keyboard. Once the last focusable item before the disabled primary input receives focus, pressing Tab again will move focus outside of the modal to the next focusable item on the rest of the page.
Reduced test case

Specifications
- Are you using the React components? (Y/N): Y
- Polaris version number: v10.10.1
- Browser: Chrome v107
- Device: MacBook Pro
- Operating System: macOS Ventura 13.0