File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -38,15 +38,17 @@ export class PushbuttonElement extends LitElement {
38
38
39
39
render ( ) {
40
40
const { color } = this ;
41
+ const buttonFill = this . pressed ? 'url(#grad-down)' : 'url(#grad-up)' ;
42
+
41
43
return html `
42
44
< button
43
45
aria-label ="${ color } pushbutton "
44
46
@mousedown =${ this . down }
45
- @mouseup =${ this . up }
47
+ @mouseup =${ ( e : MouseEvent ) => ! e . ctrlKey && this . up ( ) }
46
48
@touchstart=${ this . down }
47
49
@touchend=${ this . up }
48
50
@keydown=${ ( e : KeyboardEvent ) => SPACE_KEYS . includes ( e . key ) && this . down ( ) }
49
- @keyup=${ ( e : KeyboardEvent ) => SPACE_KEYS . includes ( e . key ) && this . up ( ) }
51
+ @keyup=${ ( e : KeyboardEvent ) => SPACE_KEYS . includes ( e . key ) && ! e . ctrlKey && this . up ( ) }
50
52
>
51
53
< svg
52
54
width ="18mm "
@@ -92,7 +94,7 @@ export class PushbuttonElement extends LitElement {
92
94
/>
93
95
</ g >
94
96
< g class ="clickable-element ">
95
- < circle class ="button-circle " cx ="6 " cy ="6 " r ="3.822 " fill ="url(#grad-up) " />
97
+ < circle class ="button-circle " cx ="6 " cy ="6 " r ="3.822 " fill ="${ buttonFill } " />
96
98
< circle
97
99
cx ="6 "
98
100
cy ="6 "
You can’t perform that action at this time.
0 commit comments