Skip to content

Commit

Permalink
[Dropdown] Bugfix - Text in dropdown not in correct vertical position (
Browse files Browse the repository at this point in the history
…#2080)

## Summary
Additional styling evaded the effectiveness of the original fix for this issue. Styling has been adjusted to only affect dropdown display when in an article, and not an exercise. Also, the same styling fix is applied to `.perseus-block-math` within the dropdown (and only in articles) for the same margin problem when MathJax is involved.

Issue: LEMS-2742

## Test plan:
1. Open an article with a dropdown (i.e. [test everything article](https://www.khanacademy.org/internal-courses/test-everything/test-everything-1/te-dropdown/a/dropdown-with-labels))
   * Dropdown content should be vertically centered within the dropdown border
1. Open an article with a dropdown that includes MathJax (i.e. [Numeric Input playground](https://www.khanacademy.org/internal-courses/numeric-input-playground/x54d9a5944b916654:test-cases/x54d9a5944b916654:input-number-to-numeric/a/article) - temporarily)
   * Dropdown content should be vertically centered within the dropdown border
1. Open an exercise with a dropdown (i.e. [Basic Input to Numeric Input](https://www.khanacademy.org/internal-courses/numeric-input-playground/x54d9a5944b916654:test-cases/x54d9a5944b916654:input-number-to-numeric/e/input-to-numeric) last question - temporarily)
   * Dropdown content should be vertically centered within the dropdown border

Author: mark-fitzgerald

Reviewers: SonicScrewdriver

Required Reviewers:

Approved By: SonicScrewdriver

Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x)

Pull Request URL: #2080
  • Loading branch information
mark-fitzgerald authored Jan 8, 2025
1 parent 781cc7d commit c9a28b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tricky-windows-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": patch
---

[Dropdown] Bugfix - Text in dropdown not in correct vertical position
3 changes: 2 additions & 1 deletion packages/perseus/src/styles/perseus-renderer.less
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@
padding: 25px 25px 0 0;
}

.perseus-dropdown .perseus-renderer .paragraph {
.perseus-article .perseus-dropdown .perseus-renderer .paragraph,
.perseus-article .perseus-dropdown .perseus-renderer .perseus-block-math {
/* overriding overly broad selectors in .framework-perseus rules */
margin-bottom: 0 !important;
font-size: 18px !important;
Expand Down

0 comments on commit c9a28b3

Please sign in to comment.