Skip to content

Commit

Permalink
Revert "fix(select): fixes Select bug that caused fwChange not to b…
Browse files Browse the repository at this point in the history
…e fired for last multi-select option"

This reverts commit 2313678.
  • Loading branch information
asif-ahmed-1990 committed May 6, 2020
1 parent 6582c30 commit 20ea1c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"hooks": {
"pre-push": "npm run test",
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
"pre-commit": "lint-staged && npm run test"
"pre-commit": "lint-staged"
}
},
"lint-staged": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/select/select.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { Meta, Story, Preview, Props } from "@storybook/addon-docs/blocks";
<fw-select multiple label="Select the GOT house" state-text="Choose the house where you belong" required="true">
<fw-select-option value="1">Starks</fw-select-option>
<fw-select-option value="2">Lannisters</fw-select-option>
<fw-select-option value="3" selected>Sand</fw-select-option>
<fw-select-option value="3" selected disabled>Sand</fw-select-option>
<fw-select-option value="4">Greyjoys</fw-select-option>
<fw-select-option value="5">Tyrell</fw-select-option>
</fw-select>
Expand Down
3 changes: 1 addition & 2 deletions src/components/select/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export class Select {

@Watch('options')
optionsChangedHandler() {

this.renderInput();
}

Expand Down Expand Up @@ -178,8 +179,6 @@ export class Select {
if (selectedOptions.length > 0) {
this.value = this.multiple ? selectedOptions.map(option => option.value) : selectedOptions[0].value || '';
this.selectInput.value = this.multiple ? '' : selectedOptions[0].text || '';
} else if (selectedOptions.length === 0) {
this.value = undefined;
}
}

Expand Down

0 comments on commit 20ea1c0

Please sign in to comment.