MDCDrawer@1.1.0 crashes when no item is active
See original GitHub issueBugs
MdcDrawer (modal variant) without any active item crashes when opened:
https://codepen.io/cmath10/pen/wObyWR
But dismissable variant works fine:
https://codepen.io/cmath10/pen/WmBMwW
Got it in console:
Error: You can’t have a focus-trap without at least one focusable element index.js:198 y index.js:198 b index.js:268 n index.js:72 trapFocus component.ts:147 opened_ foundation.ts:39 handleTransitionEnd foundation.ts:146 handleTransitionEnd_ component.ts:100
What MDC Web Version are you using?
1.1.0
What browser(s) is this bug affecting?
Firefox 66.0.1 Chrome 73.0.3683.86
What OS are you using?
Linux Mint 19.1
What are the steps to reproduce the bug?
- Open codepens above.
- Open console.
- Open drawer.
- See behavior.
What is the expected behavior?
No errors in console, no crashes
What is the actual behavior?
App crashed, console has error message
Any other information you believe would be useful?
Possible workaround - adding empty anchor to menu top:
<a href="#"></a>
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Resolve Acrobat intermittent crashes on Windows
Solution 4: Launch Acrobat Distiller and check if Acrobat is activated · Press Windows key + R to open the Run command window....
Read more >Active Directory Replication Status Tool crashing
Hi, Some recent .Net update broke the app. It crashes right after the splash screen. Application: repl.exe Framework Version: v4.0.30319 Description: The.
Read more >Editing resource file crashes Visual Studio
Every time I try to edit any resource file in any UWP project in my solution, Visual Studio crashes and restarts. I've not...
Read more >Use Crash Detection on iPhone or Apple Watch to call for help ...
Crash Detection is designed to detect severe car crashes—such as front-impact, side-impact, and rear-end collisions, and rollovers—involving ...
Read more >Issue Tracker - Grounded - Obsidian Entertainment
Fixed on Live Slashing weapons are not able to be upgraded after choosing the Spicy, Mint, or Salty path. Patch 0.13.3 Fixes. Fixed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for spotting it! The list expects at least one item to have
tabindex="0"
. I fixed your example by simply addingtabindex="0"
to first list item. See MDCList’s Accessibility section.Here is the updated codepen that has fix.
@abhiomkar
I read the comment, and example of dismissible drawer you provided: https://stackblitz.com/edit/mdc-drawer-demo-ytwosc?file=index.html
This still not clear for me. I noticed that drawer in your example has no items with class
mdc-list-item--activated
ormdc-list-item--selected
. I have the same drawer content in my modal drawer, it crashes if no item has classmdc-list-item--activated
, if i add it to entry, problem disappears, but i really need menu in my app without already selected item(s). I hasmdc-list
with items like<a class="mdc-list-item" href="#">...<a>
, why these anchors is not focusable, but empty is?aria-selected="true"
does not help as well.