yandex-ui/nanoislands

Active sub-option isn't selected

Closed this issue · 2 comments

4ega commented

When we create nb-select with selected item in group, select is empty.

issue

Could you give me yate code example, plz.

4ega commented

Sure, here is example from demo code:

    nb-select( {
      'size': 'm'
      'id': 'select-gropu1'
      'class': 'my-test-class'
      'items': [
          {
              'text': 'Карта'
              'value': 'option1'
              //'selected': 'true'   <== moved from upper level of options
          }
          {
              'text': 'Спутник'
              'value': 'option2'
          }
          {
              'text': 'Гибрид'
              'value': 'option3'
          }
            {
                'separator': true()
            }
          {
              'text': 'Группа'
              'group': [
                    {
                        'text': 'Супер Карта'
                        'value': 'option4'
                        'selected': 'true' //  <== to lower level
                    }
                    {
                        'text': 'Супер Спутник'
                        'value': 'option5'
                    }
                    {
                        'text': 'Супер Гибрид'
                        'value': 'option6'
                    }
              ]
          }
      ]
    })