Skip to content

Commit c8873cc

Browse files
committed
v0.4.0-rc.1
1 parent 3d18367 commit c8873cc

File tree

6 files changed

+41
-29
lines changed

6 files changed

+41
-29
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@
55
# IDE
66
.idea
77

8-
example/ModalDropdown.js
9-
108
npm-debug.log

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
.idea
2+
.npmignore
13
example
24
docs

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ You can find them in the example.
2121

2222
## Update History
2323

24+
### v0.4.0-rc.1
25+
- New feature: [\#11](https://github.com/sohobloo/react-native-modal-dropdown/issues/11) Open `renderSeparator` prop API.
26+
- New feature:
27+
[\#10](https://github.com/sohobloo/react-native-modal-dropdown/issues/10) Support touchable component in `renderRow`.
28+
2429
### v0.3.2
2530
- Fix bug: [\#9](https://github.com/sohobloo/react-native-modal-dropdown/issues/9) *undefined is not an object (evaluating '_this.updatePosition.bind')* in v0.3.1.
2631
- Fix bug: Wrong width of dropdown in very few cases.
@@ -42,7 +47,7 @@ Now you can use these component as a wrapper / container. Anything wrapped in it
4247

4348
## Installation
4449
```sh
45-
npm i react-native-modal-dropdown --save
50+
npm i react-native-modal-dropdown -S
4651
```
4752

4853
## Usage
@@ -68,7 +73,7 @@ Give the style props as your choice:
6873
- `textStyle`: Change the style of text of the button. *Invalid in wrapper mode.*
6974
- `dropdownStyle`: Change the style of dropdown container.
7075

71-
You can also render your option row by implement the `renderRow` function.
76+
You can also render your option row and row separator by implement `renderRow` and `renderSeparator` function.
7277

7378
## API
7479
### Props
@@ -82,6 +87,7 @@ Prop | Type | Optional | Default | Description
8287
`textStyle` | object | Yes | | Style of the button text. **Invalid in wrapper mode.**
8388
`dropdownStyle` | object | Yes | | Style of the dropdown list.
8489
`renderRow` | func | Yes | | Customize render option rows. **Will render a default row if `null`/`undefined`.**
90+
`renderSeparator` | func | Yes | | Customize render dropdown list separators. **Will render a default thin gray line if `null`/`undefined`.**
8591
`onDropdownWillShow`| func | Yes | | Trigger when dropdown will show by touching the button. **Return `false` can cancel the event.**
8692
`onDropdownWillHide`| func | Yes | | Trigger when dropdown will hide by touching the button. **Return `false` can cancel the event.**
8793
`onSelect` | func | Yes | | Trigger when option row touched with selected `index` and `value`. **Return `false` can cancel the event.**

example/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import {
1616
ScrollView,
1717
} from 'react-native';
1818

19-
// import ModalDropdown from 'react-native-modal-dropdown';
20-
import ModalDropdown from './ModalDropdown';
19+
import ModalDropdown from 'react-native-modal-dropdown';
2120

2221
const DEMO_OPTIONS_1 = ['option 1', 'option 2', 'option 3', 'option 4', 'option 5', 'option 6', 'option 7', 'option 8', 'option 9'];
2322

@@ -39,7 +38,6 @@ class Demo extends Component {
3938
<View style={styles.row}>
4039
<View style={styles.cell}>
4140
<ModalDropdown style={styles.dropdown_1}
42-
dropdownStyle={styles.test}
4341
options={DEMO_OPTIONS_1}
4442
/>
4543
<ModalDropdown style={styles.dropdown_6}
@@ -205,7 +203,6 @@ const styles = StyleSheet.create({
205203
flex: 1,
206204
borderWidth: StyleSheet.hairlineWidth,
207205
},
208-
209206
scrollView: {
210207
flex: 1,
211208
},
@@ -224,7 +221,7 @@ const styles = StyleSheet.create({
224221
dropdown_1: {
225222
flex: 1,
226223
top: 32,
227-
left: 8
224+
left: 8,
228225
},
229226
dropdown_2: {
230227
alignSelf: 'flex-end',

example/package.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
{
2-
"name": "Demo",
3-
"version": "0.3.2",
4-
"private": true,
5-
"scripts": {
6-
"start": "node node_modules/react-native/local-cli/cli.js start"
7-
},
2+
"name": "react-native-modal-dropdown-demo",
3+
"version": "0.4.0-rc.1",
4+
"description": "A demo for react-native-modal-dropdown component.",
5+
"homepage": "https://github.com/sohobloo/react-native-modal-dropdown",
6+
"license": "MIT",
7+
"author": "sohobloo <sohobloo@live.cn> (https://github.com/sohobloo)",
88
"dependencies": {
99
"react": "15.3.1",
1010
"react-native": "0.33.0",
11-
"react-native-modal-dropdown": "0.3.2"
12-
}
11+
"react-native-modal-dropdown": "0.4.0-rc.1",
12+
},
13+
"scripts": {
14+
"start": "node node_modules/react-native/local-cli/cli.js start"
15+
},
16+
"private": true
1317
}

package.json

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
{
22
"name": "react-native-modal-dropdown",
3-
"version": "0.3.2",
3+
"version": "0.4.0-rc.1",
44
"description": "A react-native dropdown component for both iOS and Android.",
5-
"main": "index.js",
6-
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
8-
},
9-
"repository": {
10-
"type": "git",
11-
"url": "https://github.com/sohobloo/react-native-modal-dropdown.git"
12-
},
13-
"author": "sohobloo <sohobloo@live.cn> (https://github.com/sohobloo)",
14-
"license": "MIT",
155
"keywords": [
166
"react",
177
"react-component",
@@ -25,5 +15,20 @@
2515
"select",
2616
"selector",
2717
"option"
28-
]
18+
],
19+
"homepage": "https://github.com/sohobloo/react-native-modal-dropdown",
20+
"bugs": {
21+
"url": "https://github.com/sohobloo/react-native-modal-dropdown/issues",
22+
"email": "sohobloo@live.cn"
23+
},
24+
"license": "MIT",
25+
"author": "sohobloo <sohobloo@live.cn> (https://github.com/sohobloo)",
26+
"main": "index.js",
27+
"repository": {
28+
"type": "git",
29+
"url": "https://github.com/sohobloo/react-native-modal-dropdown.git"
30+
},
31+
"scripts": {
32+
"test": "echo \"Error: no test specified\" && exit 1"
33+
}
2934
}

0 commit comments

Comments
 (0)