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 - Для false-like значения не вызывается stringify #228

Closed
1 of 9 tasks
AleksandrSibiakov opened this issue Apr 28, 2023 · 4 comments
Closed
1 of 9 tasks
Assignees
Labels
source:idp issue from IDP state:ready ready for release (pass tested) type:bug Something isn't working
Milestone

Comments

@AleksandrSibiakov
Copy link
Contributor

AleksandrSibiakov commented Apr 28, 2023

Библиотека

Выберите нужное отметив галочку [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

Компонент

SelectComponent

Версия

latest

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

select_stringify

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

При установке false-like значений (false, null, undefined, '', 0), stringify не отрабатывает

В примере выше: Вручную и Автоматически транслируются в false/true значения formControl
По итогу строковое представление не отображается как для начального так и при смене значения.

this.requiredInputControl.setValue(item && this.stringify(item));

P.S. заметил дублирующий вызов updateValue

@irustm irustm added the source:idp issue from IDP label May 2, 2023
@ZurabDev ZurabDev self-assigned this May 3, 2023
@ZurabDev ZurabDev added this to the 1.0.0-beta.36 milestone May 3, 2023
@ZurabDev ZurabDev added state:in_progress We work on this issue state:ready ready for release (pass tested) and removed state:in_progress We work on this issue labels May 5, 2023
@AleksandrSibiakov
Copy link
Contributor Author

В версии 1.0.0-rc.1 все еще воспроизводится.

@AleksandrSibiakov
Copy link
Contributor Author

AleksandrSibiakov commented May 15, 2023

Посмотрел чуть дальше. Вызов stringify делается, но для самого контрола this.select(value); срабатывает второй раз из refreshLocalValue со значением FormControl-а. А не айтема! item != formControl.value и stringify проваливается.
У нас например селекты так устроены:
items: [{id: T; name: string}]
stringify = (item) => item.name
valueTransformer : { toControlValue(componentValue) { return componentValue?.id; } }

@alexhawkins94 alexhawkins94 added the type:bug Something isn't working label Jul 3, 2023
@alexhawkins94
Copy link

@AleksandrSibiakov актуально ?

@AleksandrSibiakov
Copy link
Contributor Author

Насчет последнего комментария - не знаю. Мы изменили имплементацию в приложениях, так что если проблема и осталась, нашли обходной путь.
Если наткнемся, заведем еще раз, все равно версии уже ушли вперед, да и сам контрол deprecated стал

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source:idp issue from IDP state:ready ready for release (pass tested) type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants