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]: Select Widget issue for dynamic Label/Key with JS Toggle #38235

Open
1 task done
tomjose92 opened this issue Dec 18, 2024 · 0 comments
Open
1 task done

[Bug]: Select Widget issue for dynamic Label/Key with JS Toggle #38235

tomjose92 opened this issue Dec 18, 2024 · 0 comments
Assignees
Labels
Bug Something isn't working Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Production Select Widget Select or dropdown widget Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets

Comments

@tomjose92
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Description

The Select widget has the fields Label key and Value key, which has a JS toggle option.
In older versions like around v1.36, a user was allowed to enable the JS toggle and configure these fields based on the source data.
Scenarios like {{item.name + " " + item.code}} used to work

A user reported after updating to the latest version (currently v1.52, not sure which version it broke), this has stopped working. The expectation is to hardcode the intended key or choose it from the dropdown.
We can no longer create a combination of values from the source data.

Also the current implementation still allows you to use something like {{item.name}}, but it basically checks for the evaluated value in respective objects of source data, which is completely wrong as no architecture would require that functionality.

Either we need to stop showing it as part of autocomplete and throw error if a user tries to use {{item.<property_name>}} inside the JS toggle, as that is very confusing.
Or we should revert back to the older functionality of allowing users to use {{item.name}} which works.

IMO, it should be the latter as this also allows us to create combinations of Label or Value fields which is very convenient and we have seen other users also use it extensively in the older version.
This will remove the need for using a .map function to combine data for Label or Value field. Previously I have used workarounds like this in many Select widgets to achieve such combinations but always felt its too much code, sometimes even moving it to a JSObject.
Instead allowing to use {{item.name}} and ability to combine with other properties will simplify the Select widget configuration greatly.

Steps To Reproduce

  1. Drag and Drop a Select widget
  2. It will have default Source data which we can use
  3. Inside the Label key field, enable JS and type {{item.code}}
  4. There are no errors, but the widget will start showing blanks in the dropdown
  5. Also on inspecting the Label field, you can see that its searching for the evaluated value in the source data's objects which is wrong

Public Sample App

No response

Environment

Production

Severity

Medium (Frustrating UX)

Issue video log

No response

Version

Cloud

@tomjose92 tomjose92 added Bug Something isn't working Select Widget Select or dropdown widget Needs Triaging Needs attention from maintainers to triage labels Dec 18, 2024
@Nikhil-Nandagopal Nikhil-Nandagopal added Medium Issues that frustrate users due to poor UX Production labels Dec 18, 2024
@github-actions github-actions bot added Widgets Product This label groups issues related to widgets Widgets & Accelerators Pod Issues related to widgets & Accelerators labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Production Select Widget Select or dropdown widget Widgets & Accelerators Pod Issues related to widgets & Accelerators Widgets Product This label groups issues related to widgets
Projects
None yet
Development

No branches or pull requests

6 participants