-
Notifications
You must be signed in to change notification settings - Fork 38
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
Cannot update mathquill configuration after mount #28
Comments
Hi @iamdiogo, thank you for the detailed issue. I didn't know that mathquill had the |
Yeah, I'll give it a go later this week |
I experienced the same issue but with the onMoveOut handler. Notice that when you change the react-mathquill version to 0.28, it works as expected. |
@alx-ppv The problem with |
I noticed that
EditableMathField
persists the initialmathquill
configuration passed on mount.There are cases where updating the internal configuration could be required. An example of this is when we're defining custom handlers for the editor.
By persisting the initial configuration, if those handlers require access to state variables, those handlers would be using old versions of those handlers, with the old value of those state variables.
To illustrate this, I made a simple example: https://codesandbox.io/s/react-mathquill-old-config-persistent-8stef
Note:
I understand that it is still possible to manually set the configuration by accessing the
mathquill
object directly, but this new addition could be great forreact-mathquill
.Regarding the implementation of it, I noticed
mathquill
has a method.config(config)
that could be used for updating the configuration.This method could be used on a per-field basis, so there is no need to re-combine the custom
edit
handler required byreact-mathquill
.The text was updated successfully, but these errors were encountered: