From c68a3a4bc03bfff161c090af355ebdca405ed639 Mon Sep 17 00:00:00 2001 From: Adrian Schmidt Date: Fri, 16 Nov 2018 09:58:20 +0100 Subject: [PATCH] refactor(limel-chip-set): move method higher up in file and watcher further down --- src/components/chip-set/chip-set.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/chip-set/chip-set.tsx b/src/components/chip-set/chip-set.tsx index 7343bc1c57..920f972ebd 100644 --- a/src/components/chip-set/chip-set.tsx +++ b/src/components/chip-set/chip-set.tsx @@ -94,9 +94,10 @@ export class ChipSet { this.handleTextInput = this.handleTextInput.bind(this); } - @Watch('value') - public handleChangeChips() { - this.textValue = ' '; + @Method() + public focus() { + this.editMode = true; + this.host.shadowRoot.querySelector('input').focus(); } public componentDidLoad() { @@ -129,12 +130,6 @@ export class ChipSet { } } - @Method() - public focus() { - this.editMode = true; - this.host.shadowRoot.querySelector('input').focus(); - } - public render() { if (this.type === 'input') { return this.renderInputChips(); @@ -152,6 +147,11 @@ export class ChipSet { ); } + @Watch('value') + protected handleChangeChips() { + this.textValue = ' '; + } + private createMDCChipSet() { this.mdcChipSet = new MDCChipSet( this.host.shadowRoot.querySelector('.mdc-chip-set')