File tree 1 file changed +15
-0
lines changed
src/components/icon-button
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ import { IconSize } from '@limetech/lime-elements';
13
13
styleUrl : 'icon-button.scss' ,
14
14
} )
15
15
export class IconButton {
16
+ public constructor ( ) {
17
+ this . removeFocusedStateOnClick = this . removeFocusedStateOnClick . bind (
18
+ this
19
+ ) ;
20
+ }
21
+
16
22
/**
17
23
* The icon to display.
18
24
*/
@@ -56,6 +62,13 @@ export class IconButton {
56
62
}
57
63
}
58
64
65
+ private removeFocusedStateOnClick ( ) {
66
+ const mdcButton = this . host . shadowRoot . querySelector (
67
+ '.mdc-icon-button'
68
+ ) ;
69
+ mdcButton . classList . remove ( 'mdc-ripple-upgraded--background-focused' ) ;
70
+ }
71
+
59
72
public connectedCallback ( ) {
60
73
this . initialize ( ) ;
61
74
}
@@ -72,10 +85,12 @@ export class IconButton {
72
85
73
86
this . mdcIconButtonRipple = new MDCRipple ( element ) ;
74
87
this . mdcIconButtonRipple . unbounded = true ;
88
+ this . host . addEventListener ( 'click' , this . removeFocusedStateOnClick ) ;
75
89
}
76
90
77
91
public disconnectedCallback ( ) {
78
92
this . mdcIconButtonRipple ?. destroy ( ) ;
93
+ this . host . removeEventListener ( 'click' , this . removeFocusedStateOnClick ) ;
79
94
}
80
95
81
96
public render ( ) {
You can’t perform that action at this time.
0 commit comments