File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed
Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,9 @@ export const SelectableMixin = <T extends Constructor<LitElement>>(
104104
105105 readonly #onKeydown = ( e : KeyboardEvent ) => {
106106 if ( e . code !== 'Space' && e . code !== 'Enter' ) return ;
107- this . #onClick( e ) ;
107+ if ( e . composedPath ( ) . indexOf ( this . #selectableTarget) === 0 ) {
108+ this . #onClick( e ) ;
109+ }
108110 } ;
109111
110112 readonly #onClick = ( e : Event ) => {
Original file line number Diff line number Diff line change @@ -94,7 +94,8 @@ export class UUICardMediaElement extends UUICardElement {
9494 ifDefined (
9595 this . target === '_blank' ? 'noopener noreferrer' : undefined ,
9696 ) ,
97- ) } >
97+ ) }
98+ @click = ${ ( e : MouseEvent ) => e . stopPropagation ( ) } >
9899 ${ this . #renderContent( ) }
99100 </ a>
100101 ` ;
@@ -120,7 +121,9 @@ export class UUICardMediaElement extends UUICardElement {
120121 <div id= "select-border" > </ div>
121122
122123 <slot name= "tag" > </ slot>
123- <slot name= "actions" > </ slot> ` ;
124+ <slot
125+ name= "actions"
126+ @click = ${ ( e : MouseEvent ) => e . stopPropagation ( ) } > </ slot> ` ;
124127 }
125128
126129 static styles = [
Original file line number Diff line number Diff line change @@ -64,6 +64,20 @@ export const Actions: Story = {
6464 } ,
6565} ;
6666
67+ export const Href : Story = {
68+ args : {
69+ 'actions slot' : html `< uui-button
70+ slot ="actions "
71+ look ="secondary "
72+ label ="Remove "
73+ > Remove</ uui-button
74+ > ` ,
75+ selectable : true ,
76+ href : 'https://umbraco.com' ,
77+ target : '_blank' ,
78+ } ,
79+ } ;
80+
6781export const Image : Story = {
6882 args : {
6983 slot : html `< img src ="https://placedog.net/1447/?random " alt ="" /> ` ,
You can’t perform that action at this time.
0 commit comments