akveo / akveo/nebular

Replace 'multiple' property with 'isShowCheckbox' in NbOptionComponent to control it outside

Open
#1,965 0 comments 0 reactions 0 assignees View on GitHub
enhancement module:components needs triage
Dominant language
TypeScript
Stars
8.1k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

### Issue type

**I'm submitting a ...** (check one with "x")

* [ ] bug report
* [x] feature request

### Issue description

**Current behavior:**

NbOptionComponent has _multiple_ property, which determines whether option should be with checkbox (multiple select).
After adding new _autocomplete component_ (https://github.com/akveo/nebular/pull/1947) _parent_ property may not be set, because NbOptionComponent can be used in NbAutocompleteComponent, which doesn't have _multiple_ property. So now we have check on _multiple_ property getter.

**Expected behavior:**

Control of multiple select mode outside component via _isShowCheckbox_.

**Related code:**

```
get multiple() {
// We check parent existing because parent can be NbSelectComponent or
// NbAutocomplete and `miltiple` property exists only in NbSelectComponent
return this.parent ? (>this.parent).multiple : false;
}
```

**Angular, Nebular**
```
Angular: 8.0.0
Nebular 4.2.1
```

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.