File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 3939 < h2 id ="methods "> Methods</ h2 >
4040 < dl >
4141 < dt > dismiss()</ dt >
42- < dd > Dismisses the pill.</ dd >
42+ < dd > Dismiss the pill (removes element from the DOM) .</ dd >
4343 </ dl >
4444 </ section >
4545{% endblock %}
Original file line number Diff line number Diff line change @@ -39,20 +39,19 @@ export class HXPillElement extends HXElement {
3939 }
4040
4141 /**
42- * Programmatically dismiss the pill (removes element from the DOM).
42+ * Dismiss the pill (removes element from the DOM)
4343 */
4444 dismiss ( ) {
45- this . remove ( ) ;
45+ if ( this . $emit ( 'dismiss' ) ) {
46+ // only if event was not canceled by consumer
47+ this . remove ( ) ;
48+ }
4649 }
4750
4851 /** @private */
4952 _onDismiss ( evt ) {
5053 evt . preventDefault ( ) ;
51-
52- if ( this . $emit ( 'dismiss' ) ) {
53- // only if event was not canceled by consumer
54- this . dismiss ( ) ;
55- }
54+ this . dismiss ( ) ;
5655 }
5756
5857 /** @private */
You can’t perform that action at this time.
0 commit comments