bem / bem/bem-components

Block select with bemjson as an option behaves wrongly

Open
#1,591 1 comment 0 reactions 0 assignees View on GitHub
ready
Dominant language
JavaScript
Stars
330
Forks
88
PR merge metrics
No merged PRs in 30d

Description

Block `select` with custom bemjson as an options (modifier mode is set to radio) in `_updateButton` method will use `domElem.text()` in `menu-item`'s method `getText` and will return a sting instead of that bemjson.

ex:

```
options: [
{val: 1, text: {block: 'form', elem: 'price', mods: {type: 'rub'}, content: 'Р'}},
{val: 2, text: '$'}
]
```

when first option will be checked:

`select._updateButton -> select._getCheckedItems() -> menu-item.getText() => 'P'` instead of `'

P
`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.