Skip to content

Commit

Permalink
Refactor steps for percentage inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
gurbindersingh committed Jul 11, 2024
1 parent 15e459e commit 962ad3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { inputs } from "./inputs";
function renderControls() {
let footnoteCounter = 1;
const settingsMap = new Map(Object.entries(settings));

const inputElements = inputs
.map((input) => {
const { label, description, settingsKey, isPercentage, id, footnote } = input;
Expand All @@ -21,7 +21,7 @@ function renderControls() {
<label class="label">${label}</label>
<input
value="${isPercentage ? (100 * value).toPrecision(3) : value}"
step="${isPercentage ? 0.05 : 1}"
step="${isPercentage ? 0.1 : 1}"
aria-label="${label}"
id="${id}"
class="input"
Expand Down

0 comments on commit 962ad3f

Please sign in to comment.