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

Closed
3 tasks done
sandrooco opened this issue Dec 13, 2024 · 0 comments · Fixed by #3300
Closed
3 tasks done

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

sandrooco opened this issue Dec 13, 2024 · 0 comments · Fixed by #3300
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

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
Projects
Development

Successfully merging a pull request may close this issue.

2 participants