Socket
Socket
Sign inDemoInstall

react-native-autosuggest

Package Overview
Dependencies
0
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.18 to 0.0.19

vendor/throttle-debounce/.editorconfig

6

package.json

@@ -79,5 +79,3 @@ {

},
"dependencies": {
"throttle-debounce": "^1.0.1"
},
"dependencies": {},
"description": "an autosuggest text input implementation for react native.",

@@ -100,3 +98,3 @@ "devDependencies": {},

},
"version": "0.0.18"
"version": "0.0.19"
}
# AutoSuggest TextInput Component
![alt tag](https://github.com/silesky/react-native-autosuggest/blob/259c32a3cec308e30994d708f4abeb33572ed6b9/demo.gif)
![alt tag](https://raw.githubusercontent.com/silesky/react-native-autosuggest/259c32a3cec308e30994d708f4abeb33572ed6b9/demo.gif)

@@ -12,2 +12,5 @@ ## Installation

## Example:
check the [index.ios.js](https://github.com/silesky/AutosuggestExample/blob/master/index.ios.js) in the example repo.
~~import { TextInput } from 'react-native'~~

@@ -22,20 +25,22 @@ `import AutoSuggest from 'react-native-autosuggest';`

```
## Props
#### Mandatory
* `onChangeText` (__function__, fired when the input changes.)
* `terms` (__Array__, list of suggestions e.g. ['Chicago', 'New York', 'San Francisco'])
#### Optional
* `onChangeTextDebounce` (__integer__, the minimum break *in milliseconds* that the onChangeText callback needs to take before firing again. **default is 200.**)
* `onItemPress` (__function__ fired when an item in the menu is pressed with that item's string value as the argument. You probably don't need this, and should just use onChangeText)
* `clearBtn` (__Array__ e.g. only if you want a custom btn component `[<MyCustomClearButtonComponent />]` , **default is undefined**.)
* `clearBtnStyles` (__Object__)
* `containerStyles` (__Object__) -- applies to the entire application
* `placeholder` (__String__)
* `placeholderTextColor` (__string__)
* `otherTextInputProps` (__object__, check the [TextInput](https://facebook.github.io/react-native/docs/textinput.html) docs for the full list)
* `textInputStyles` (__Object__ applies to the TextInput component e.g {width: 400, backgroundColor: "black"})
* `rowWrapperStyles`(__Object__)
* `rowTextStyles` (__Object__)
| Prop | Type | Optional | Default | Description |
|-------|-------|----------|---------|--------------|
| `onChangeText` | Function | false | (prop is manadatory) | fired when the input changes. e.g (ev) => console.log(event)
| `terms` | Array | false | (prop is mandatory) | list of suggestions. e.g ['Chicago', 'New York', 'San Francisco'] |
| `onChangeTextDebounce` | Number | true | 300 | the minimum break *in milliseconds* that the onChangeText callback needs to take before firing again. |
| `onItemPress` | Function | true | undefined | fired when an item in the menu is pressed with that item's string value as the argument. You probably don't need this, and should just use onChangeText
| `placeholder` | String | true | '' | e.g 'please enter a name' |
| `clearBtnStyles` | Object | true | ...see src | styles that go around your clear btn |
| `clearBtnVisibility` | Bool | true | false | is the clear input button visible? |
| `clearBtn` | Array | true | undefined | only if you want a custom btn component | [<MyCustomClearButtonComponent />]|
| `containerStyles` | Object | true | ...see src | applies to the entire application |
| `placeholderTextColor` | String | true | 'lightgrey' | placeholder text color |
| `otherTextInputProps` | Object | true | undefined | check the [TextInput](https://facebook.github.io/react-native/docs/textinput.html) docs for the full list) |
| `textInputStyles` | Object | true | undefined | applies to the TextInput component e.g {width: 400, backgroundColor: "black"})
| `rowWrapperStyles` | Object | true | undefined | applies to the View around the dropdown |
| `rowTextStyles` | Object | true | undefined | applies the dropdown text

@@ -14,3 +14,3 @@ import React, { Component, PropTypes } from 'react'

} from 'react-native'
import { debounce } from 'throttle-debounce'
import { debounce } from './../vendor/throttle-debounce/debounce'
import { version } from 'react-native/package.json'

@@ -17,0 +17,0 @@ const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc