Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
BUG FIX: Select组件当value为0时,该option不被选中.
Browse files Browse the repository at this point in the history
  • Loading branch information
shenlq committed Jul 20, 2016
1 parent 7c90042 commit cede5ad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "impression-react",
"version": "0.1.11",
"version": "0.1.12",
"author": "peter.shenlq",
"description": "An enterprise-class UI design language and React-based implementation.",
"main": "./lib/index.js",
"scripts": {
"eslint": "eslint ./src/scripts/",
"scss-lint": "scss-lint src/styles/**/*.scss",
"scsslint": "scss-lint src/styles/**/*.scss",
"clean": "rimraf ./lib && mkdir lib",
"copy": "cp -a src/styles lib/styles",
"compile-js": "node_modules/babel-cli/bin/babel.js src/scripts --out-dir lib",
"compile-scss": "sass src/styles/index.scss lib/index.css",
"compile-min-scss": "sass --style compressed src/styles/index.scss lib/index.min.css",
"deploy": "npm run eslint && npm run scss-lint && npm run clean && npm run compile-js && npm run compile-scss && npm run compile-min-scss && npm run copy && npm publish"
"compilejs": "node_modules/babel-cli/bin/babel.js src/scripts --out-dir lib",
"compilescss": "sass src/styles/index.scss lib/index.css",
"compileminscss": "sass --style compressed src/styles/index.scss lib/index.min.css",
"deploy": "npm run eslint && npm run scsslint && npm run clean && npm run compilejs && npm run compilescss && npm run compileminscss && npm run copy && npm publish"
},
"repository": {
"type": "git",
Expand Down
10 changes: 5 additions & 5 deletions site/scripts/views/SelectView.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ export default class SelectView extends Component{
<Form type="inline">
<Form.Group>
<label>defaultValue:</label>
<Select value="3">
<Select.Option value="1">First</Select.Option>
<Select.Option value="2">Second</Select.Option>
<Select.Option value="3">Third</Select.Option>
<Select value={0}>
<Select.Option value={0}>First</Select.Option>
<Select.Option value={1}>Second</Select.Option>
<Select.Option value={2}>Third</Select.Option>
</Select>
</Form.Group>
</Form>
Expand Down Expand Up @@ -100,4 +100,4 @@ export default class SelectView extends Component{
}
}

SelectView.title = 'Select';
SelectView.title = 'Select';
2 changes: 1 addition & 1 deletion src/scripts/components/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default class Select extends Component{

this.state = {
showOption: false,
value: props.value || undefined,
value: props.value !== undefined? props.value : undefined,
};

this.toggleOptionsHandle = this.toggleOptionsHandle.bind(this);
Expand Down

0 comments on commit cede5ad

Please sign in to comment.