Skip to content

Cannot update mathquill configuration after mount #28

Description

@iamdiogo

I noticed that EditableMathField persists the initial mathquill 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 for react-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 by react-mathquill.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions