File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed
source/nodejs/adaptivecards-designer/src Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -1718,3 +1718,16 @@ a.default-ac-anchor:visited:active {
17181718 visibility : hidden;
17191719 }
17201720}
1721+
1722+ .screen-reader-only {
1723+ border : 0 ;
1724+ clip : rect (0 , 0 , 0 , 0 );
1725+ clip-path : inset (50% );
1726+ width : 1px ;
1727+ height : 1px ;
1728+ padding : 0 ;
1729+ margin : -1px ;
1730+ overflow : hidden;
1731+ position : absolute;
1732+ white-space : nowrap;
1733+ }
Original file line number Diff line number Diff line change @@ -1525,7 +1525,11 @@ export class CardDesigner extends Designer.DesignContext {
15251525 text : ( trigger ) => JSON . stringify ( this . getBoundCard ( ) , null , 4 )
15261526 } )
15271527 . on ( "error" , ( ) => this . _copyJSONButton . renderedElement . focus ( ) )
1528- . on ( "success" , ( ) => this . _copyJSONButton . renderedElement . focus ( ) ) ;
1528+ . on ( "success" , ( ) => {
1529+ this . _copyJSONButton . renderedElement . focus ( )
1530+
1531+ this . toolbar . addAlert ( "Card payload copied" ) ;
1532+ } ) ;
15291533 }
15301534
15311535 // Tool palette panel
Original file line number Diff line number Diff line change @@ -334,6 +334,7 @@ export class ToolbarChoicePicker extends ToolbarElement {
334334export class Toolbar {
335335 private _elements : Array < ToolbarElement > = [ ] ;
336336 private _attachedTo : HTMLElement ;
337+ private _alertPanel : HTMLDivElement ;
337338
338339 private createSeparatorElement ( ) : HTMLElement {
339340 let separatorElement = document . createElement ( "div" ) ;
@@ -395,6 +396,10 @@ export class Toolbar {
395396
396397 this . _attachedTo . appendChild ( leftContainer ) ;
397398 this . _attachedTo . appendChild ( rightContainer ) ;
399+
400+ this . _alertPanel = document . createElement ( "div" ) ;
401+ this . _alertPanel . className = "screen-reader-only" ;
402+ this . _attachedTo . appendChild ( this . _alertPanel ) ;
398403 }
399404
400405 addElement ( element : ToolbarElement ) {
@@ -438,4 +443,11 @@ export class Toolbar {
438443 // specified id
439444 this . _elements . splice ( 0 , 0 , element ) ;
440445 }
446+
447+ addAlert ( alertText : string ) {
448+ var alert = document . createElement ( 'div' ) ;
449+ alert . innerHTML = alertText ;
450+ alert . setAttribute ( "aria-live" , "polite" ) ;
451+ this . _alertPanel . appendChild ( alert ) ;
452+ }
441453}
You can’t perform that action at this time.
0 commit comments