Skip to content

Commit

Permalink
fix(rating): Fieldset in Chrome does not work with flex (fixes #19)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardtke committed Apr 24, 2021
1 parent 797c83d commit 3bd3a20
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/tpl/templates/_components/rating.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ export function Rating(name: string, value = 0, readonly = false) {
const current = i / 2;
stars += html`
<input type="radio" id="${name}-${i}" name="${name}" value="${current}" autocomplete="off"
${current === comparisonValue && " checked"}${readonly &&
" disabled"}/>
<label for="${name}-${i}" title="${!readonly && current}" ${half &&
"class=\"half\""}>
${current === comparisonValue && " checked"}${readonly && " disabled"}/>
<label for="${name}-${i}" title="${!readonly && current}" ${half && `class="half"`}>
${Icon(`star-${half ? "half" : "fill"}` as IconName)}
</label>
`;
}

return html`
<fieldset class="rating${readonly && " disabled"}">
<div class="rating${readonly && " disabled"}">
${stars}
</fieldset>
</div>
`;
}

0 comments on commit 3bd3a20

Please sign in to comment.