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

IdsDropdown/IdsListBox: Issue with selecting & displaying the value at index 0 #2686

Closed
NikosLardas opened this issue Aug 7, 2024 · 2 comments · Fixed by #2821
Closed

IdsDropdown/IdsListBox: Issue with selecting & displaying the value at index 0 #2686

NikosLardas opened this issue Aug 7, 2024 · 2 comments · Fixed by #2821
Assignees
Labels
type: bug 🐛 Something isn't working [3] Velocity rating (Fibonacci)

Comments

@NikosLardas
Copy link

Describe the bug
In our Angular project, the ids-dropdown component, combined with ids-list-box, does not select and display properly the value at index 0. Setting it as the value will retain the value 0 as the value of the dropdown, but it will still not display the item as selected when the dropdown is closed. We did extensive debugging on our end, tried setting the value in the TypeScript and HTML files and a number of variations, but this bug persists.

To Reproduce

Code sample:

   <ids-dropdown
        [attr.label]="'PROCESS_MINING.INSIGHTS.WIDGET_CONFIGURATION.DATA_TO_DISPLAY' | transloco"
        formControlName="data"
        ngDefaultControl
    >
        <ids-list-box>
            <ids-list-box-option group-label>Attributes</ids-list-box-option>
            <ids-list-box-option *ngFor="let field of allFieldValues; let i = index" [attr.id]="i" [attr.value]="i"
                >{{ field.name.name | renameToCaseId }} ({{ field.name.businessObjectName }})
            </ids-list-box-option>
        </ids-list-box>
    </ids-dropdown>

Setting [attr.value]=0 will still not select the first option, as well as doing the same in TypeScript or with any of the ids-dropdown methods. The value attribute will be set correctly to 0, but the item won't be selected in the UI.

Demo:

screen-capture.webm

Expected behavior

The value at index 0 is selected when the dropdown is rendered and closed, and it shows as selected with a blue background color when the dropdown is opened.

Version

ids-enterprise-wc: 1.4.0
Angular: 16.2

@tmcconechy tmcconechy added type: bug 🐛 Something isn't working [3] Velocity rating (Fibonacci) labels Aug 7, 2024
@tmcconechy
Copy link
Member

For us the value is not an index its the value attribute. What if you used value="0" in this case (whatever is in the string attribute.

But will look further into this. Just a first impression

@NikosLardas
Copy link
Author

Hi Tim, even if we set value=0 the problem persists in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working [3] Velocity rating (Fibonacci)
Development

Successfully merging a pull request may close this issue.

3 participants