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] @prizm-ui/components - Switcher не реагирует на выставление выбранного элемента если опции приходят асинхронно #1476

Closed
1 of 9 tasks
ZyfraKonstantinKulik opened this issue Mar 19, 2024 · 0 comments · Fixed by #1839
Assignees
Labels
state:ready ready for release (pass tested) type:bug Something isn't working version:3 version:4
Milestone

Comments

@ZyfraKonstantinKulik
Copy link

ZyfraKonstantinKulik commented Mar 19, 2024

Библиотека

Выберите нужное отметив галочку [x]

  • @prizm-ui/core
  • @prizm-ui/components
  • @prizm-ui/install
  • @prizm-ui/icons
  • @prizm-ui/flag-icons
  • @prizm-ui/theme
  • @prizm-ui/charts
  • @prizm-ui/ast
  • @prizm-ui/nx-plugin

Компонент

prizm-switcher

Версия

Операционная ситема:

Windows 10

Браузер: Chrome Version 122.0.6261.129 (Official Build) (64-bit)

Google Chrome Версия 96.0.4664.110 (Официальная сборка), (x86_64)

NodeJS:

➜ node --version
v16.13.0

Dependencies:

➜ npm ls @prizm-ui/components

@prizm-ui/components 1.4.4
➜ npm ls @angular/core
$ npm ls @angular/core
npm ERR! code ELSPROBLEMS
npm ERR! invalid: @angular/[email protected] C:\projects\Energy Control\front\node_modules\@angular\core
[email protected] C:\projects\Energy Control\front
├─┬ @angular/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @angular/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @angular/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @angular/[email protected]
│ └── @angular/[email protected] deduped
├── @angular/[email protected]
├─┬ @angular/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @angular/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @angular/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @angular/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @angular/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @ng-web-apis/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @ng-web-apis/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @ng-web-apis/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @ngrx/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @ngrx/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @ngrx/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @ngrx/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @ngrx/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @prizm-ui/[email protected]
│ ├── @angular/[email protected] deduped
│ └─┬ @ng-web-apis/[email protected]
│   └── @angular/[email protected] deduped invalid: ">=15.0.0" from node_modules/angular-svg-icon, "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0" from node_modules/primeng
├─┬ @prizm-ui/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @prizm-ui/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @prizm-ui/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @prizm-ui/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @prizm-ui/[email protected]
│ └── @angular/[email protected] deduped
├─┬ @taiga-ui/[email protected]
│ ├── @angular/[email protected] deduped
│ ├─┬ @ng-web-apis/[email protected]
│ │ └── @angular/[email protected] deduped invalid: ">=15.0.0" from node_modules/angular-svg-icon, "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0" from node_modules/primeng
│ ├─┬ @tinkoff/[email protected]
│ │ └── @angular/[email protected] deduped invalid: ">=15.0.0" from node_modules/angular-svg-icon, "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0" from node_modules/primeng
│ └─┬ @tinkoff/[email protected]
│   └── @angular/[email protected] deduped invalid: ">=15.0.0" from node_modules/angular-svg-icon, "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0" from node_modules/primeng
├─┬ [email protected]
│ └── @angular/[email protected] deduped invalid: ">=15.0.0" from node_modules/angular-svg-icon
├─┬ [email protected]
│ └── @angular/[email protected] deduped invalid: ">=15.0.0" from node_modules/angular-svg-icon
├─┬ [email protected]
│ └── @angular/[email protected] deduped invalid: ">=15.0.0" from node_modules/angular-svg-icon
├─┬ [email protected] invalid: "14.2.4" from node_modules/@prizm-ui/components
│ └── @angular/[email protected] deduped invalid: ">=15.0.0" from node_modules/angular-svg-icon
└─┬ [email protected]
  └── @angular/[email protected] deduped invalid: ">=15.0.0" from node_modules/angular-svg-icon, "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0" from node_modules/primeng

Проект в котором используется Prizm

  • Энергоконтроль

Скрин / Видео проблемы

Воспроизведение проблемы

Проблема воспроизводится, когда мы используем prizm-switcher, опции для которого "switchers" устанавливаются через пайп async. Если выставить желаемое значение для выбора, до того как, опции пришли, когда опции отрисуются значение не будет выбрано а выбрана будет первая опция.

<prizm-switcher [switchers]="switchers$ | async" [selectedSwitcherIdx]="1" type="inner" size="l"></prizm-switcher>

Ожидаем что будет выбрана вторя опция, но выберется первая.

Так же это актруально если просто задать индекс выбранног элемента раньше чем опции

<prizm-switcher [selectedSwitcherIdx]="1" [switchers]="[{title: '1'},{title: '2'}]"  type="inner" size="l"></prizm-switcher>

Ожидаем что будет выбрана вторя опция, но выберется первая.

Описание проблемы

@ickisIckis ickisIckis added the type:bug Something isn't working label Mar 19, 2024
@ickisIckis ickisIckis self-assigned this Mar 20, 2024
@ickisIckis ickisIckis added this to the 4.4.0 milestone Jun 26, 2024
@ickisIckis ickisIckis added the state:in_progress We work on this issue label Jul 1, 2024
@ickisIckis ickisIckis added state:ready ready for release (pass tested) and removed state:in_progress We work on this issue labels Jul 3, 2024
@ickisIckis ickisIckis modified the milestones: 4.4.0, 4.3.6 Jul 12, 2024
This was referenced Jul 17, 2024
ZurabDev added a commit that referenced this issue Jul 17, 2024
fix(components/switcher): fix async support for selected switcher #1476
ZurabDev added a commit that referenced this issue Sep 20, 2024
fix(components/switcher): fix async support for selected switcher #1476
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:ready ready for release (pass tested) type:bug Something isn't working version:3 version:4
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants