setHoverRating(null)} use:focusOutside={{ onFocusOut: reset }} use:shortcuts={[ { shortcut: { key: 'ArrowLeft' }, preventDefault: false, onShortcut: (event) => event.stopPropagation() }, { shortcut: { key: 'ArrowRight' }, preventDefault: false, onShortcut: (event) => event.stopPropagation() }, ]} > {$t('rating')}
{#each { length: count } as _, index (index)} {@const value = index + 1} {@const filled = hoverRating === null ? (ratingSelection || 0) >= value : hoverRating >= value} {@const starId = `${id}-${value}`} { focusRating = value as Rating; }} onchange={() => handleSelectDebounced(value as Rating)} class="sr-only" /> {/each}
{#if ratingSelection !== null && !readOnly} {/if}