Skip to content

Commit

Permalink
Fixed indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nupur Grover committed Jan 18, 2018
1 parent cb76594 commit 16f3254
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 21 deletions.
20 changes: 9 additions & 11 deletions content/docs/forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,23 +188,21 @@ It is also possible to select multiple options within a `<select>` tag, by enabl

The `handleChange` method from the above example would then change to get the selected values from `event.target.selectedOptions`.

```javascript{4,10-12,24}
```js{2}
handleChange(event) {
const selectedFlavors = Array.from(event.target.selectedOptions).map(function(option){
return option.value;
});
this.setState({value: selectedFlavors});
}
const selectedFlavors = Array.from(event.target.selectedOptions).map(options => option.value);
this.setState({value: selectedFlavors});
}
```

The `<select>` inside the render would also change to pass an array to the `value` attribute:

```javascript{4,10-12,24}
```html
<select value={this.state.value} onChange={this.handleChange} multiple={true}>
<option value="grapefruit">Grapefruit</option>
<option value="lime">Lime</option>
<option value="coconut">Coconut</option>
<option value="mango">Mango</option>
<option value="grapefruit">Grapefruit</option>
<option value="lime">Lime</option>
<option value="coconut">Coconut</option>
<option value="mango">Mango</option>
</select>
```

Expand Down
41 changes: 31 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2346,6 +2346,14 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1"
sha.js "^2.4.8"

create-react-class@^15.6.0:
version "15.6.2"
resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.2.tgz#cf1ed15f12aad7f14ef5f2dfe05e6c42f91ef02a"
dependencies:
fbjs "^0.8.9"
loose-envify "^1.3.1"
object-assign "^4.1.1"

cross-env@^3.1.1:
version "3.2.4"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-3.2.4.tgz#9e0585f277864ed421ce756f81a980ff0d698aba"
Expand Down Expand Up @@ -3587,7 +3595,7 @@ fb-watchman@^2.0.0:
dependencies:
bser "^2.0.0"

fbjs@^0.8.12, fbjs@^0.8.14, fbjs@^0.8.16:
fbjs@^0.8.12, fbjs@^0.8.14, fbjs@^0.8.16, fbjs@^0.8.9:
version "0.8.16"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
dependencies:
Expand Down Expand Up @@ -4611,12 +4619,6 @@ graphql-skip-limit@^1.0.9:
babel-runtime "^6.26.0"
graphql "^0.11.7"

graphql@0.10.5:
version "0.10.5"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.10.5.tgz#c9be17ca2bdfdbd134077ffd9bbaa48b8becd298"
dependencies:
iterall "^1.1.0"

graphql@^0.11.3, graphql@^0.11.7:
version "0.11.7"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.11.7.tgz#e5abaa9cb7b7cccb84e9f0836bf4370d268750c6"
Expand Down Expand Up @@ -5579,7 +5581,7 @@ items@2.x.x:
version "2.1.1"
resolved "https://registry.yarnpkg.com/items/-/items-2.1.1.tgz#8bd16d9c83b19529de5aea321acaada78364a198"

iterall@1.1.3, iterall@^1.1.0:
iterall@1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.1.3.tgz#1cbbff96204056dde6656e2ed2e2226d0e6d72c9"

Expand Down Expand Up @@ -8193,7 +8195,16 @@ react-dev-utils@^4.2.1:
strip-ansi "3.0.1"
text-table "0.2.0"

react-dom@16.0.0, react-dom@^15.6.0, react-dom@^16.0.0:
react-dom@^15.6.0:
version "15.6.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.6.2.tgz#41cfadf693b757faf2708443a1d1fd5a02bef730"
dependencies:
fbjs "^0.8.9"
loose-envify "^1.1.0"
object-assign "^4.1.0"
prop-types "^15.5.10"

react-dom@^16.0.0:
version "16.0.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.0.0.tgz#9cc3079c3dcd70d4c6e01b84aab2a7e34c303f58"
dependencies:
Expand Down Expand Up @@ -8272,7 +8283,17 @@ react-side-effect@^1.1.0:
exenv "^1.2.1"
shallowequal "^1.0.1"

react@16.0.0, react@^15.6.0, react@^16.0.0:
react@^15.6.0:
version "15.6.2"
resolved "https://registry.yarnpkg.com/react/-/react-15.6.2.tgz#dba0434ab439cfe82f108f0f511663908179aa72"
dependencies:
create-react-class "^15.6.0"
fbjs "^0.8.9"
loose-envify "^1.1.0"
object-assign "^4.1.0"
prop-types "^15.5.10"

react@^16.0.0:
version "16.0.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.0.0.tgz#ce7df8f1941b036f02b2cca9dbd0cb1f0e855e2d"
dependencies:
Expand Down

0 comments on commit 16f3254

Please sign in to comment.