Skip to content

Fixes crash caused by ValueNodeWrapper rendering incorrect value #170

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

Merged
merged 3 commits into from
Feb 13, 2025

Conversation

kyaw-t
Copy link
Contributor

@kyaw-t kyaw-t commented Feb 12, 2025

Fix for #169
Added a data parameter to the getInputComponent function so that the rejected value from inputProps.value doesn't get passed to the ValueNode.

Copy link
Owner

@CarlosNZ CarlosNZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for spotting this and providing a quick fix. Looks good to me! I just have one tiny suggestion -- if we're passing data into the getInputComponent function, we don't need to also pass dataType.

kyaw-t and others added 2 commits February 12, 2025 19:11
Copy link
Contributor Author

@kyaw-t kyaw-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for catching that! looks good 👍

@CarlosNZ CarlosNZ merged commit 9cf462c into CarlosNZ:main Feb 13, 2025
@CarlosNZ
Copy link
Owner

Brilliant, much appreciated!

@CarlosNZ
Copy link
Owner

I'll make a new build and release later today 👍

@CarlosNZ
Copy link
Owner

Released in v1.22.3 now 👍

@CarlosNZ
Copy link
Owner

Hey, @kyaw-t , had to do an emergency fix for this, cos we inadverdantly caused a worse problem! #171 😆

Turns out a more thorough fix was just to remove the "update local state" call within the handleDataTypeChange and just let it re-render due to a data change -- that way it only changes if its actually been acceped by the onEdit function.

The problem with what we did yesterday is that it sends the data as the local value to each value component, which needs to be updated every keystroke, but data is only updated when "submitting" the value.

Anyway, here is the commit if you're interested: 6daabed

@kyaw-t
Copy link
Contributor Author

kyaw-t commented Feb 13, 2025

Ah got it. I should've tested it a little more thoroughly. 😆
But glad the issue got resolved in the end though!

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

Successfully merging this pull request may close these issues.

Bug report: Component crashes when onUpdate prevents changing data type to Object
2 participants