File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 3030 </ ol >
3131 </ hx-dd >
3232 </ hx-def >
33+ < hx-def >
34+ < hx-dt > Events</ hx-dt >
35+ < hx-dd >
36+ Any of the following:
37+ < ul >
38+ < li > < code > close</ code > </ li >
39+ < li > < code > open</ code > </ li >
40+ </ ul >
41+ </ hx-dd >
42+ </ hx-def >
3343 </ hx-dl >
3444 </ section >
3545{% endblock %}
Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ export class HXPopoverElement extends HXElement {
3737 this . $defaultAttribute ( 'position' , 'bottom-right' ) ;
3838 this . _initialPosition = this . position ;
3939
40+ this . setAttribute ( 'aria-hidden' , ! this . open ) ;
41+
4042 if ( ! this . id ) {
4143 return ;
4244 }
@@ -61,8 +63,13 @@ export class HXPopoverElement extends HXElement {
6163 document . removeEventListener ( 'click' , this . _closeOnBackdropClick ) ;
6264 }
6365
64- attributeChangedCallback ( attr , oldValue , newValue ) {
65- this . setAttribute ( 'aria-hidden' , newValue !== '' ) ;
66+ attributeChangedCallback ( attr , oldVal , newVal ) {
67+ let isOpen = ( newVal !== null ) ;
68+ this . setAttribute ( 'aria-hidden' , ! isOpen ) ;
69+
70+ if ( newVal !== oldVal ) {
71+ this . $emit ( isOpen ? 'open' : 'close' ) ;
72+ }
6673 }
6774
6875 _toggle ( ) {
You can’t perform that action at this time.
0 commit comments