Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ltr directionality in 2 widgets #1788

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/nervous-plants-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@khanacademy/math-input": minor
"@khanacademy/perseus": minor
---

Add styling to some math widgets to override rtl settings in rtl languages.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`keypad should snapshot expanded: first render 1`] = `
class="default_xu2jcg-o_O-wrapper_144oaus-o_O-expandedWrapper_ykafj"
>
<div
class="default_xu2jcg-o_O-tabbar_721koc"
class="default_xu2jcg-o_O-tabbar_zvl22d"
>
<div
class="default_xu2jcg-o_O-pages_cjo0m2"
Expand Down Expand Up @@ -169,7 +169,7 @@ exports[`keypad should snapshot expanded: first render 1`] = `
/>
</div>
<div
class="default_xu2jcg-o_O-keypadInnerContainer_uc6399"
class="default_xu2jcg-o_O-keypadInnerContainer_huowys"
>
<div
aria-label="Keypad"
Expand Down Expand Up @@ -1065,7 +1065,7 @@ exports[`keypad should snapshot unexpanded: first render 1`] = `
class="default_xu2jcg-o_O-wrapper_144oaus"
>
<div
class="default_xu2jcg-o_O-tabbar_721koc"
class="default_xu2jcg-o_O-tabbar_zvl22d"
>
<div
class="default_xu2jcg-o_O-pages_cjo0m2"
Expand Down Expand Up @@ -1225,7 +1225,7 @@ exports[`keypad should snapshot unexpanded: first render 1`] = `
/>
</div>
<div
class="default_xu2jcg-o_O-keypadInnerContainer_uc6399"
class="default_xu2jcg-o_O-keypadInnerContainer_huowys"
>
<div
aria-label="Keypad"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`mobile keypad should render keypad when active 1`] = `
class="default_xu2jcg-o_O-wrapper_144oaus"
>
<div
class="default_xu2jcg-o_O-tabbar_721koc"
class="default_xu2jcg-o_O-tabbar_zvl22d"
>
<div
class="default_xu2jcg"
Expand Down Expand Up @@ -60,7 +60,7 @@ exports[`mobile keypad should render keypad when active 1`] = `
</div>
</div>
<div
class="default_xu2jcg-o_O-keypadInnerContainer_uc6399"
class="default_xu2jcg-o_O-keypadInnerContainer_huowys"
>
<div
aria-label="Keypad"
Expand Down
1 change: 1 addition & 0 deletions packages/math-input/src/components/keypad/keypad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ const styles = StyleSheet.create({
display: "flex",
flexDirection: "row",
backgroundColor: "#DBDCDD",
direction: "ltr",
},
keypadGrid: {
display: "grid",
Expand Down
1 change: 1 addition & 0 deletions packages/math-input/src/components/tabbar/tabbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const styles = StyleSheet.create({
justifyContent: "space-between",
paddingTop: 2,
paddingBottom: 2,
direction: "ltr",
},
pages: {
display: "flex",
Expand Down
2 changes: 2 additions & 0 deletions packages/perseus/src/styles/perseus-renderer.less
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,8 @@

border: unset;

direction: ltr;

&.mq-focused {
box-shadow: unset;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/perseus/src/widgets/expression/expression.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ export class Expression
</LabelSmall>
)}
<KeypadInput
// style={styles.ltr}
// eslint-disable-next-line react/no-string-refs
ref="input"
ariaLabel={
Expand Down Expand Up @@ -408,6 +409,9 @@ const styles = StyleSheet.create({
desktopLabelInputWrapper: {
margin: "5px 5px 0",
},
// ltr: {
// direction: "ltr",
// },
});

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ exports[`graded-group-set should render all graded groups 1`] = `
autocapitalize="off"
autocomplete="off"
autocorrect="off"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-input_19vw1dn"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-input_e1hk8y"
id="input-with-examples-bnVtZXJpYy1pbnB1dCAx"
type="text"
value=""
Expand Down Expand Up @@ -297,7 +297,7 @@ exports[`graded-group-set should render all graded groups 1`] = `
autocapitalize="off"
autocomplete="off"
autocorrect="off"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-input_19vw1dn"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-input_e1hk8y"
id="input-with-examples-bnVtZXJpYy1pbnB1dCAx"
type="text"
value=""
Expand Down Expand Up @@ -526,7 +526,7 @@ exports[`graded-group-set should render all graded groups 1`] = `
autocapitalize="off"
autocomplete="off"
autocorrect="off"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-input_19vw1dn"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-input_e1hk8y"
id="input-with-examples-bnVtZXJpYy1pbnB1dCAx"
type="text"
value=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ exports[`graded group widget should snapshot 1`] = `
autocapitalize="off"
autocomplete="off"
autocorrect="off"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-input_19vw1dn"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-input_e1hk8y"
id="input-with-examples-bnVtZXJpYy1pbnB1dCAx"
type="text"
value=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ exports[`group widget should snapshot: initial render 1`] = `
autocapitalize="off"
autocomplete="off"
autocorrect="off"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-input_19vw1dn"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-input_e1hk8y"
id="input-with-examples-bnVtZXJpYy1pbnB1dCAx"
type="text"
value=""
Expand Down Expand Up @@ -958,7 +958,7 @@ exports[`group widget should snapshot: initial render 1`] = `
autocapitalize="off"
autocomplete="off"
autocorrect="off"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-input_19vw1dn"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-input_e1hk8y"
id="input-with-examples-bnVtZXJpYy1pbnB1dCAy"
type="text"
value=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ exports[`numeric-input widget Should render predictably: after interaction 1`] =
autocapitalize="off"
autocomplete="off"
autocorrect="off"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-focused_1z0d9ul-o_O-input_19vw1dn"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-focused_1z0d9ul-o_O-input_e1hk8y"
id="input-with-examples-bnVtZXJpYy1pbnB1dCAx"
type="text"
value="1252"
Expand Down Expand Up @@ -303,7 +303,7 @@ exports[`numeric-input widget Should render predictably: first render 1`] = `
autocapitalize="off"
autocomplete="off"
autocorrect="off"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-input_19vw1dn"
class="input_1t4b01j-o_O-LabelMedium_1rew30o-o_O-default_53h0n9-o_O-input_e1hk8y"
id="input-with-examples-bnVtZXJpYy1pbnB1dCAx"
type="text"
value=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ export class NumericInput
width: this.props.size === "small" ? 40 : 80,
padding: 0,
height: "auto",
direction: "ltr",
},
});

Expand Down