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

[Bug]: null as defaultValue evaluates to 0 in Input widget number type #11839

Closed
1 task done
sbalaji1192 opened this issue Mar 14, 2022 · 14 comments · Fixed by #11923
Closed
1 task done

[Bug]: null as defaultValue evaluates to 0 in Input widget number type #11839

sbalaji1192 opened this issue Mar 14, 2022 · 14 comments · Fixed by #11923
Assignees
Labels
Bug Something isn't working Verified When issue is retested post its fixed Widgets Product This label groups issues related to widgets

Comments

@sbalaji1192
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Description

When {{null}} is bound to defaultValue of Input widget Number type, it evaluates to 0.

Steps To Reproduce

  1. Add an input widget to the canvas
  2. choose Number type
  3. Set {{null}} as defaultValue in property pane
  4. Input has 0 as value.

Public Sample App

No response

Version

clound

@sbalaji1192 sbalaji1192 added Bug Something isn't working Widgets Product This label groups issues related to widgets labels Mar 14, 2022
@sbalaji1192 sbalaji1192 self-assigned this Mar 14, 2022
@sbalaji1192
Copy link
Contributor Author

CC @ashit-rath

@btsgh
Copy link
Collaborator

btsgh commented Mar 23, 2022

  1. Tried this bug on Production environment - Was able to reproduce the issue.
  2. Tried it on release environment - An error comes up to the effect - "This value must be a number" (View attached screenshot)

Bug11839_StagingEnv

@sbalaji1192 @dilippitchika

@sbalaji1192
Copy link
Contributor Author

@btsgh
WRT,
-1, it is expected. This change has not been promoted to master.
-2, @dilippitchika do we need to allow null value and treat it as empty?

@dilippitchika
Copy link
Contributor

@sbalaji1192 is this a migration?

@dilippitchika
Copy link
Contributor

Me and @ashit-rath were discussing this that we should support null overall in all the widgets. We will need to do on a bigger level. If this is not a migration, we are good to go with this fix.

@sbalaji1192
Copy link
Contributor Author

@dilippitchika Could you explain what do you mean by migration?

@dilippitchika
Copy link
Contributor

If the user is already using {{null}} in their number input widget and it was going to 0, what will happen to those number inputs now?

@sbalaji1192
Copy link
Contributor Author

@dilippitchika We won't convert the value to 0 and show an error border around the defaultValue.

@dilippitchika
Copy link
Contributor

@sbalaji1192 won't this break flows which are using {{null}}?

@sbalaji1192
Copy link
Contributor Author

@dilippitchika It won't break the application. Just that input value will be empty. Is it not a edge case?

@dilippitchika
Copy link
Contributor

Not sure, because the data has changed for those cases. Is this in production now?

@sbalaji1192
Copy link
Contributor Author

@dilippitchika yeah. This is in production now.

@dilippitchika
Copy link
Contributor

Discussed with @sbalaji1192, the conlusion is - No changes to this PR, it will stay the same. We haven't heard from users yet, so we think this change is fine for now.

In future, we are planning to support null values across all fields

@btsgh
Copy link
Collaborator

btsgh commented Apr 4, 2022

As per comments above and my observation on Release, marking this issue as fixed.

@btsgh btsgh added Verified When issue is retested post its fixed and removed QA Needs QA attention labels Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Verified When issue is retested post its fixed Widgets Product This label groups issues related to widgets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants