Skip to content
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

Input value won't get updated #2227

Closed
edward1127 opened this issue Dec 22, 2023 · 4 comments
Closed

Input value won't get updated #2227

edward1127 opened this issue Dec 22, 2023 · 4 comments
Assignees
Labels

Comments

@edward1127
Copy link

sandbox

Screencast.from.12-21-2023.05.49.20.PM.webm

Description

Value within the mathlive won't update

Steps to Reproduce

click the "add 1 button"

Actual Behavior

only the value display outside the input will be updated

Expected Behavior

both outside and within mathlive values should be updated

@truebluepl
Copy link

It's problem within your app. Did you update math-field value onClick button event?

@edward1127
Copy link
Author

@truebluepl I'm not sure how react communicates with web components, but when the value state is updated in react, it triggers the rerender and mathlive's HTML does look like it's getting updated. However, the mathlive's value update is not reflected in the actual rendering. Are you suggesting that using setValue is insufficient, and I have to do something like mf.current.value = <updated value> manually?
image

@arnog arnog self-assigned this Dec 22, 2023
@arnog arnog added the bug label Dec 22, 2023
@arnog
Copy link
Owner

arnog commented Dec 22, 2023

It's a bug. Updating the content of a mathfield currently does not trigger an update to its value. I have checked in a fix for it.

As a workaround, you would have to set the value property of the mathfield.

@edward1127
Copy link
Author

@arnog thank you for checking it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants