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

DropDown node payload null instead of 0 #1585

Open
A380Coding opened this issue Jan 21, 2025 · 6 comments
Open

DropDown node payload null instead of 0 #1585

A380Coding opened this issue Jan 21, 2025 · 6 comments
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do

Comments

@A380Coding
Copy link

Current Behavior

Using Dropdown Node with one Option set to 0 there is an issue. When selecting this Option in dashboard, the payload is null instead of 0

Image

This only happens to the value 0. If the value is changed to some other value, the returned payload is correct.

Expected Behavior

When selecting Option with value 0 the payload should be 0 instead of null

Steps To Reproduce

Create Dropdown with 2 options. First option set to value 0 second option set to value 1.
Connect a debug node to the output of dopdown to show payload.
Select the options back and forth and check the debug output. The debut output showas paylod null or payload 1. But it should be payload 0 or payload 1.

Environment

  • Dashboard version: 1.22.0
  • Node-RED version: 4.08
  • Node.js version:
  • npm version:
  • Platform/OS: Win10
  • Browser: Firefox latest

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

@A380Coding A380Coding added bug Something isn't working needs-triage Needs looking at to decide what to do labels Jan 21, 2025
@A380Coding
Copy link
Author

Additionally, if you change the selection and change it back to 0, then change to another page, go back to the page with the drop down. Now the label is within the dropdown list.

@bartbutenaers
Copy link
Contributor

Hi @A380Coding,

Had a quick view at the code, and indeed I would expect the dropdown would behave like you describe. Because that if(this.value) should be false (instead of true) for the following values:

Image

But instead it seems to work fine for some reason:

Image

If you see what I am doing different from you, please let me know.
Now I am off to the daily job...

@A380Coding
Copy link
Author

A380Coding commented Jan 22, 2025

I'm just using numbers, not a mix of int, bool, string

Image

Image

@bartbutenaers
Copy link
Contributor

Did a quick test during my lunch break.
First I couldn't reproduce it, but I assume you have deactivated the "Allow search" feature

Image

That is why it is always very helpful to share a simple flow here, so others can reproduce the problem easily
Will fix it tonight.

@A380Coding
Copy link
Author

A380Coding commented Jan 22, 2025

It is deactivated yes. Next time I will export the sample. It seemed to be easy to replicate but I understand it wasn't

@bartbutenaers
Copy link
Contributor

@A380Coding
Here you go...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do
Projects
Status: Backlog
Development

No branches or pull requests

2 participants