refactor(all): strict boolean conditions

This commit is contained in:
Manu Mtz.-Almeida
2018-08-31 18:59:09 +02:00
parent f383ebdf13
commit ba2230510e
96 changed files with 983 additions and 955 deletions

View File

@ -8,11 +8,11 @@ SelectOption is a component that is a child element of Select. For more informat
## Properties
| Property | Attribute | Description | Type |
| ---------- | ---------- | ------------------------------------------------------------------------------ | --------- |
| `disabled` | `disabled` | If true, the user cannot interact with the select option. Defaults to `false`. | `boolean` |
| `selected` | `selected` | If true, the element is selected. | `boolean` |
| `value` | -- | The text value of the option. | `any` |
| Property | Attribute | Description | Type |
| ---------- | ---------- | ------------------------------------------------------------------------------ | ------------- |
| `disabled` | `disabled` | If true, the user cannot interact with the select option. Defaults to `false`. | `boolean` |
| `selected` | `selected` | If true, the element is selected. | `boolean` |
| `value` | -- | The text value of the option. | `any`, `null` |
## Events

View File

@ -22,7 +22,7 @@ export class SelectOption {
/**
* The text value of the option.
*/
@Prop({ mutable: true }) value!: any;
@Prop({ mutable: true }) value!: any | null;
/**
* Emitted when the select option loads.
@ -35,7 +35,7 @@ export class SelectOption {
@Event() ionSelectOptionDidUnload!: EventEmitter<void>;
componentWillLoad() {
if (this.value === undefined) {
if (this.value == null) {
this.value = this.el.textContent || '';
}
}