desmosinc / mathquill

Magic textboxes where you can type math as easily as writing!
mathquill.com
137 stars 42 forks source link

Fix visual test substituteKeyboardEvents section. #238

Closed jwmerrill closed 2 years ago

jwmerrill commented 2 years ago

substituteKeyboardEvents is only supported in interface versions <=2, so make a MQ with interface version 2 to use for these tests.

Makes it an error to pass substituteKeyboardEvents in interface version >=3.

jwmerrill commented 2 years ago

I was looking for a good place to issue a warning (or throw an error?) if you pass this option to an interface version that doesn't support it, but haven't figured out where the right place to do that is yet. It's a little tricky because MQ allows you to configure things like this either globally or per instance.

anandthakker commented 2 years ago

I was looking for a good place to issue a warning (or throw an error?) if you pass this option to an interface version that doesn't support it

Why not a check here? https://github.com/desmosinc/mathquill/blob/59dfa66a8567d164948c43c9994147f3e83d39aa/src/publicapi.ts#L229

jwmerrill commented 2 years ago

Requesting re-review for the new error if you pass substituteKeyboardEvents to the wrong interface version.