Skip to content

Commit

Permalink
[Designer] Set focus on first card in card catalog when it loads (#4562)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcam206 authored Aug 12, 2020
1 parent 7a3e287 commit f0fcae7
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,12 @@ export class OpenSampleDialog extends Dialog {

this.catalogue.onDownloaded = (sender: SampleCatalogue) => {
if (sender.isDownloaded) {
this.setContent(this.renderCatalogue());
let catalogue = this.renderCatalogue();
this.setContent(catalogue);

// now set focus on the first card in the catalog (usually the Blank Card)
let firstChild = catalogue.firstElementChild as HTMLElement;
firstChild.focus();
}
else {
this.setContent(this.renderMessage("The catalogue couldn't be loaded. Please try again later.", false));
Expand Down

0 comments on commit f0fcae7

Please sign in to comment.