Skip to content

Commit

Permalink
Perseus Types LIES. We cannot handle the percent type in numeric input
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicScrewdriver committed Nov 15, 2024
1 parent d684a6e commit b586b71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/perseus/src/perseus-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,6 @@ export type MathFormat =
| "improper"
| "proper"
| "decimal"
| "percent"
| "pi";

export type PerseusNumericInputAnswerForm = {
Expand Down
6 changes: 5 additions & 1 deletion packages/perseus/src/widgets/numeric-input/numeric-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,11 @@ const propUpgrades = {
// input-number to numeric-input. In this case, we need to upgrade
// the widget options accordingly.
if (initialProps.value) {
const provideAnswerForm = initialProps.answerType !== "number";
// If the answerType is not number or percent, we need to provide
// the answer form for the numeric-input widget
const provideAnswerForm =
initialProps.answerType !== "number" &&
initialProps.answerType !== "percent";

// We need to determine the mathFormat for the numeric-input widget
const mathFormat =
Expand Down

0 comments on commit b586b71

Please sign in to comment.