this.roving.noteFocus(index)}
role="option"
aria-label="${artist.Name}"
aria-selected="${isSelected}"
style="
--avatar-size: ${imgSize}px;
--placeholder-font: ${placeholderFont}px;
"
@click=${(e: MouseEvent) =>
this.onArtistClick(
e,
artist,
index,
)}
@contextmenu=${(e: MouseEvent) =>
this.onArtistContextMenu(
e,
artist,
)}
@keydown=${(e: KeyboardEvent) => {
if (isContextMenuKey(e)) {
this.openArtistMenuFromKey(
e,
artist,
);
return;
}
if (
e.key === 'Enter' ||
e.key === ' '
) {
e.preventDefault();
this.clearSelection();
this.dispatchEvent(
new CustomEvent(
'navigate',
{
bubbles: true,
composed: true,
detail: {
view: 'explore-artist-details',
artistMBID:
artist.MBID || '',
artistName:
artist.Name,
localArtistId:
artist.ID,
},
},
),
);
}
}}
>
${this.renderArtistAvatar(artist)}
${artist.Name}
`;
}
private renderContextMenu() {
return html`
`;
}
override render() {
if (this.loading) {
// The header keeps its place while the view loads: a
// heading that appears only once the data does is the
// shifting layout this component exists to stop.
return html`
${this.searchCtrl.term
? 'No artists match your search.'
: 'No artists in library.'}
`;
}
return html`
${searchBar}