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]: sbb-select's current value doesn't always properly update #3298

Open
3 tasks done
sandrooco opened this issue Dec 13, 2024 · 2 comments · Fixed by #3300 · May be fixed by #3329
Open
3 tasks done

[Bug]: sbb-select's current value doesn't always properly update #3298

sandrooco opened this issue Dec 13, 2024 · 2 comments · Fixed by #3300 · May be fixed by #3329
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@sandrooco
Copy link
Contributor

sandrooco commented Dec 13, 2024

Preflight Checklist

Bug type

Functionality

It affects the following packages

Components

Which version of Lyne Components are you using

2.0.1

Operating system

any

Browser / Browser version

any

Input mode

None

Additional settings

No response

What happened?

We have a select in which the user can select a data version (similar to a git branch) they want to load data from. The default branch is called "default" by a different system, which we would like to change to "Hauptversion" or the other translations based on the browser language. If it's not the default version, it should just display the version's name (not internationalized).

Simplified it looks like this:

<sbb-select>
    @for (v of versions; track v.name) {
        <sbb-option
          [value]="v.name"
          [selected]="currentVersion() === v.name"
          >{{
            v.name === 'default'
              ? 'Hauptversion-' + currentLanguage()
              : v.name
          }}</sbb-option
        >
    }
</sbb-select>

The problem: if we change the language (and the currentLanguage-signal updates), it will actually NOT change. Though the option element inside the dropdown actually updates!
I'm honestly not sure if this is a Lyne problem or just some weird Angular change detection stuff happening. Sorry in case it's the latter. :)

Steps to reproduce the issue

Full Stackblitz repro: https://stackblitz.com/edit/angular-at-czthv9sx?file=src%2Fmain.ts
Click the de/fr/it buttons - the text in the paragraph will update as opposed to the text in the select, which is unexpected.

Relevant log output

No response

@Cyrill226
Copy link

I tested the bugfix with the latest Lyne version and noticed that it isn't working as expected. Here is a Stackblitz example that demonstrates the issue:
https://stackblitz.com/edit/angular-at-kb6wrpzc?file=src%2Fmain.html

@jeripeierSBB jeripeierSBB reopened this Dec 23, 2024
@github-project-automation github-project-automation bot moved this from Done to In progress in ESTA Web Lyne Design System Dec 23, 2024
@jeripeierSBB jeripeierSBB moved this from In progress to Next in ESTA Web Lyne Design System Dec 23, 2024
@jeripeierSBB jeripeierSBB removed their assignment Dec 23, 2024
@jeripeierSBB jeripeierSBB moved this from Next to In progress in ESTA Web Lyne Design System Dec 24, 2024
@jeripeierSBB jeripeierSBB self-assigned this Dec 24, 2024
@jeripeierSBB
Copy link
Contributor

I tested the bugfix with the latest Lyne version and noticed that it isn't working as expected. Here is a Stackblitz example that demonstrates the issue: https://stackblitz.com/edit/angular-at-kb6wrpzc?file=src%2Fmain.html

Thank you for the report, it in fact did not consider your case. I created another fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment