File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,18 @@ class VcfBreadcrumb extends ElementMixin(ThemableMixin(PolylitMixin(LitElement))
109109 anchor . setAttribute ( "id" , this . id ) ;
110110 const popover = this . querySelector ( 'vaadin-popover[for="' + this . id + '"]' ) ;
111111 if ( popover ) {
112+ anchor . addEventListener ( "keydown" , ( event ) => {
113+ if ( event . key === " " || event . key === "Space" ) {
114+ event . preventDefault ( ) ;
115+ // @ts -ignore
116+ popover . opened = ! popover . opened ;
117+ }
118+ } ) ;
119+ popover . addEventListener ( "opened-changed" , ( event ) => {
120+ if ( ! ( ( event as CustomEvent ) . detail . value ) ) {
121+ anchor . focus ( ) ; // Return focus to the ellipsis element
122+ }
123+ } ) ;
112124 anchor . appendChild ( popover ) ;
113125 }
114126 this . removeAttribute ( "id" ) ;
You can’t perform that action at this time.
0 commit comments