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 2020 < hx-dt > Permitted Children</ hx-dt >
2121 < hx-dd > flow content</ hx-dd >
2222 </ hx-def >
23+ < hx-def >
24+ < hx-dt > Events</ hx-dt >
25+ < hx-dd >
26+ Any of the following:
27+ < ul >
28+ < li > < code > close</ code > </ li >
29+ < li > < code > open</ code > </ li >
30+ </ ul >
31+ </ hx-dd >
32+ </ hx-def >
2333 </ hx-dl >
2434 </ section >
2535{% endblock %}
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ export class HXTooltipElement extends HXElement {
3636 this . $upgradeProperty ( 'open' ) ;
3737 this . $defaultAttribute ( 'role' , 'tooltip' ) ;
3838
39+ this . setAttribute ( 'aria-hidden' , ! this . open ) ;
40+
3941 if ( this . id ) {
4042 this . _target = this . getRootNode ( ) . querySelector ( '[data-tooltip=' + this . id + ']' ) ;
4143 } else {
@@ -51,8 +53,13 @@ export class HXTooltipElement extends HXElement {
5153 this . _destoryAllHandlers ( ) ;
5254 }
5355
54- attributeChangedCallback ( attr , oldValue , newValue ) {
55- this . setAttribute ( 'aria-hidden' , newValue !== '' ) ;
56+ attributeChangedCallback ( attr , oldVal , newVal ) {
57+ let isOpen = ( newVal !== null ) ;
58+ this . setAttribute ( 'aria-hidden' , ! isOpen ) ;
59+
60+ if ( newVal !== oldVal ) {
61+ this . $emit ( isOpen ? 'open' : 'close' ) ;
62+ }
5663 }
5764
5865 _hide ( ) {
You can’t perform that action at this time.
0 commit comments