material-components-web
material-components-web copied to clipboard
[MDCList MDCDialog] FocusTrap throws an error
trafficstars
Bug report
I am trying to get a simple dialog to work with a preselected item. it works propperly but still throws an error. It looks like a bug but i might be doing something wrong.
Steps to reproduce
- Go to https://codepen.io/florenso/pen/rNrWOEa
- Open chrome devtools console (the console of codepen does not show the error)
- Click on the button to open the dialog
- See error
Actual behavior
thows error:
material-components-web.min.js:1 Uncaught Error: FocusTrap: Element must have at least one focusable child. at r.trapFocus (material-components-web.min.js:1:26219) at Object.trapFocus (material-components-web.min.js:1:376068) at material-components-web.min.js:1:169218
Expected behavior
no error
Your Environment:
| Software | Version(s) |
|---|---|
| MDC Web | 14 |
| Browser | brave (chromium) |
| Operating System | windows 10 |
Additional context
The console in codepen does not show the error, only the console of crome. it only happens the first time. when you select an item and open the dialog again it works as expected.