From 8dc8690607616bb2ba46bb3fd90334cd799fa573 Mon Sep 17 00:00:00 2001 From: N <18454+nixterrimus@users.noreply.github.com> Date: Thu, 7 Sep 2023 13:03:35 -0600 Subject: [PATCH] Fix overflow in the y direction on radio choice (#706) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary: Fixes radio choice showing a scrollbar in the y direction when showing MathJax. image Issue: https://khanacademy.atlassian.net/browse/LC-1177 ## Test plan: - Visit http://localhost:8090/math/algebra2/x2ec2f6f830c9fb89:exp/x2ec2f6f830c9fb89:equivalent-exp/e/rewrite-exponential-expressions?devflagk=mathjax3 with an updated perseus - You should see math in the radio choices without overflow Additionally - Python content should continue to be scrollable in the x direction Author: nixterrimus Reviewers: nixterrimus, benchristel, nedredmond, Myranae Required Reviewers: Approved By: benchristel, nedredmond Checks: ✅ finish_coverage, ✅ Publish npm snapshot (ubuntu-latest, 16.x), ✅ Extract i18n strings (ubuntu-latest, 16.x), ✅ Check builds for changes in size (ubuntu-latest, 16.x), ✅ Check for .changeset file (ubuntu-latest, 16.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 16.x), ✅ Jest Coverage (ubuntu-latest, 16.x), ✅ Cypress Coverage (ubuntu-latest, 16.x), ✅ gerald Pull Request URL: https://github.com/Khan/perseus/pull/706 --- .changeset/nasty-islands-sin.md | 7 +++ .../multi-renderer.test.tsx.snap | 10 ++-- .../__snapshots__/group.test.tsx.snap | 10 ++-- .../__snapshots__/radio.test.ts.snap | 56 +++++++++---------- packages/perseus/src/widgets/radio/choice.tsx | 3 +- 5 files changed, 47 insertions(+), 39 deletions(-) create mode 100644 .changeset/nasty-islands-sin.md diff --git a/.changeset/nasty-islands-sin.md b/.changeset/nasty-islands-sin.md new file mode 100644 index 0000000000..63aefb974a --- /dev/null +++ b/.changeset/nasty-islands-sin.md @@ -0,0 +1,7 @@ +--- +"@khanacademy/perseus": minor +--- + +Ensure that radio widget choices can scroll horizontally, but not vertically. +Previously, unnecessary vertical scrollbars appeared on some choices containing +MathJax elements. diff --git a/packages/perseus/src/multi-items/__tests__/__snapshots__/multi-renderer.test.tsx.snap b/packages/perseus/src/multi-items/__tests__/__snapshots__/multi-renderer.test.tsx.snap index e28127636d..bf6a6554f5 100644 --- a/packages/perseus/src/multi-items/__tests__/__snapshots__/multi-renderer.test.tsx.snap +++ b/packages/perseus/src/multi-items/__tests__/__snapshots__/multi-renderer.test.tsx.snap @@ -133,7 +133,7 @@ exports[`multi-item renderer should snapshot: initial render 1`] = ` style="flex-direction: column; color: rgb(33, 36, 44);" >