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

Fix number inputs disappearing when empty. #22

Merged
merged 1 commit into from
Dec 19, 2022

Conversation

nbadal
Copy link
Contributor

@nbadal nbadal commented Dec 18, 2022

This replaces NaN with an empty string. The best approach would be to add a validation step before updating the template with invalid values, but until then. its probably better to not have fields disappearing 😅

@@ -19,7 +19,7 @@ export default () => ({
</div>
<div className='divider' />
{vnode.attrs.config.map((val) => {
if (!Types[val.type] || !vnode.attrs.value[val.key]) {
if (!Types[val.type]) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there was a specific reason for adding this, we should probably check undefined or another value rather than the falsiness of the value

@BigJk BigJk merged commit b208b4d into BigJk:master Dec 19, 2022
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.

2 participants