fix(listbox): remove usage of public class fields
This commit is contained in:
parent
8ad5cc56f1
commit
27bc805885
3 changed files with 24 additions and 2 deletions
5
.changeset/perfect-birds-relate.md
Normal file
5
.changeset/perfect-birds-relate.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@lion/listbox': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Remove usage of public class fields
|
||||||
|
|
@ -31,6 +31,22 @@ export const main = () => html`
|
||||||
`;
|
`;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Single & Multiple Choice
|
||||||
|
- Orientation
|
||||||
|
- Rotation when using keyboard for selection
|
||||||
|
|
||||||
|
## How to use
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm i --save @lion/listbox
|
||||||
|
```
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
## Multiple choice
|
## Multiple choice
|
||||||
|
|
||||||
Add `multiple-choice` flag to allow multiple values to be selected.
|
Add `multiple-choice` flag to allow multiple values to be selected.
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ export class LionOption extends DisabledMixin(ChoiceInputMixin(FormRegisteringMi
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.active = false;
|
this.active = false;
|
||||||
|
this.__onClick = this.__onClick.bind(this);
|
||||||
this.__registerEventListeners();
|
this.__registerEventListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,7 +118,7 @@ export class LionOption extends DisabledMixin(ChoiceInputMixin(FormRegisteringMi
|
||||||
this.removeEventListener('click', this.__onClick);
|
this.removeEventListener('click', this.__onClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
__onClick = () => {
|
__onClick() {
|
||||||
if (this.disabled) {
|
if (this.disabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -127,5 +128,5 @@ export class LionOption extends DisabledMixin(ChoiceInputMixin(FormRegisteringMi
|
||||||
} else {
|
} else {
|
||||||
this.checked = true;
|
this.checked = true;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue