math-input = react + redux + mathquill
JavaScript CSS HTML
Switch branches/tags
Nothing to show
Clone or download
jaredly Bugfix for native provided keypad
I missed adding `getDOMNode` to the object that gets send up the chain,
which broke everything :sad_panda:

Test Plan:
run `npm run watch`, then open `native.html` and you should be able to
interact with the input programatically! Open `index.html` (in mobile
emulation mode) and you should be able to use the html keypad still!

Auditors: hannah
Latest commit 9626a0e Jan 23, 2018

README.md

math-input

Khan Academy's new expression editor for the mobile web. Used in the Perseus exercise framework to power math input and expression editing on small screens.

Built with React, Redux, MathQuill, Aphrodite, and more.

Try it yourself on Khan Academy. (Note: you'll need to enable mobile emulation, if you're accessing the site from a desktop browser.)

Supported Features

  • Multiple keypad configurations, so as to accommodate a range of input types (i.e., fractions/mixed numbers, algebraic expressions).
  • Multi-page keypads, with swipeable page navigation.
  • Touch-and-drag interactions (as supported by the stock iOS and Android keypads).
  • A draggable cursor with a detached handle, for fine-grained control on touch devices.
  • Custom state transitions for the editing experience, to streamline expression entry.

Demo

A live demo is available via GitHub Pages. You can configure some of the keypad's behaviors, along with the set of active keys, via the editor.

Note that, as the input and keypad only respond to touch events, you'll need to enable mobile emulation (e.g., as supported by Chrome) in order to use the keypad in a desktop browser.

To run the demo locally, clone the repo, yarn install, yarn watch, and open the index.html page. The local behaviors can similarly be customized via the editor @ custom.html.

License

MIT License