@@ -50,7 +50,7 @@ export class HXAlertElement extends HXElement {
5050
5151 $onConnect ( ) {
5252 this . $upgradeProperty ( 'cta' ) ;
53- this . $upgradeProperty ( 'static ' ) ;
53+ this . $upgradeProperty ( 'persist ' ) ;
5454 this . $upgradeProperty ( 'status' ) ;
5555 this . $upgradeProperty ( 'type' ) ;
5656
@@ -66,7 +66,6 @@ export class HXAlertElement extends HXElement {
6666 static get $observedAttributes ( ) {
6767 return [
6868 'cta' ,
69- 'static' ,
7069 'status' ,
7170 'type' ,
7271 ] ;
@@ -112,20 +111,20 @@ export class HXAlertElement extends HXElement {
112111 }
113112
114113 /**
115- * Property reflecting the `static ` HTML attribute, indicating whether the
114+ * Property reflecting the `persist ` HTML attribute, indicating whether the
116115 * alert may be dismissed. If true, the dismiss button will not be shown.
117116 *
118117 * @default false
119118 * @type {Boolean }
120119 */
121- get static ( ) {
122- return this . hasAttribute ( 'static ' ) ;
120+ get persist ( ) {
121+ return this . hasAttribute ( 'persist ' ) ;
123122 }
124- set static ( value ) {
123+ set persist ( value ) {
125124 if ( value ) {
126- this . setAttribute ( 'static ' , '' ) ; // boolean
125+ this . setAttribute ( 'persist ' , '' ) ;
127126 } else {
128- this . removeAttribute ( 'static ' ) ;
127+ this . removeAttribute ( 'persist ' ) ;
129128 }
130129 }
131130
@@ -169,7 +168,7 @@ export class HXAlertElement extends HXElement {
169168 * Dismiss the alert (removes element from the DOM).
170169 */
171170 dismiss ( ) {
172- if ( this . $emit ( 'dismiss' ) ) {
171+ if ( ! this . persist && this . $emit ( 'dismiss' ) ) {
173172 // only if event was not canceled by consumer
174173 this . remove ( ) ;
175174 }
0 commit comments