simpleclub / math_keyboard

Math expression editing using an on-screen software keyboard or physical keyboard input in a typeset input field in Flutter.
https://simpleclub.github.io/math_keyboard
BSD 3-Clause "New" or "Revised" License
134 stars 50 forks source link

Problems with .addLeaf() #42

Closed AlgebraicFloat closed 1 year ago

AlgebraicFloat commented 1 year ago

Bug description

When trying to add fractions into the mathtextfield they end up giving a parser error after trying to edit

To Reproduce

Steps to reproduce the behavior: _mathController.addLeaf(r"\frac{1"); _mathController.addLeaf("2"); _mathController.addLeaf("}{3"); _mathController.addLeaf("4"); _mathController.addLeaf("}"); _mathController.addLeaf("");

try editing the fraction using the math keyboard.

Expected behavior

It would be great if you could add fractions into the mathfield by using addLeaf(). Maybe I'm just not looking in the right places for this functionality.

"Parser Error: Expected '}', got 'EOF' makes sense since I'm deleting the bracket, but how do I make the fraction editable in the mathtextfield?

github-actions[bot] commented 1 year ago

Hi 👋🏽 Thank you for opening your first issue with simpleclub/math_keyboard ❤

You can expect triage from us soon 🙂 In the meantime, you can try to search for similar issues in our issue database.

edhom commented 1 year ago

Hi @AlgebraicFloat, please have a look at addFunction() for everything that takes arguments (e.g. like fractions do)🙂