Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Designer] Set focus on first card in card catalog when it loads #4562

Merged
merged 2 commits into from
Aug 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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