From d7296eff3baaaa95ae75eed78f99faf65776ea10 Mon Sep 17 00:00:00 2001 From: kusti8 Date: Mon, 18 Jun 2018 20:42:19 -0400 Subject: [PATCH] Add clarification on selection index. Fixes #158 --- docs/component_APIs/picker.md | 58 +++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/docs/component_APIs/picker.md b/docs/component_APIs/picker.md index 7a0e429..4602001 100644 --- a/docs/component_APIs/picker.md +++ b/docs/component_APIs/picker.md @@ -11,11 +11,11 @@ class Example extends Component { render() { return ( - + - Option 1 - Option 2 - Option 3 + Option 1 + Option 2 + Option 3 @@ -28,11 +28,11 @@ render(); ## Props -- [editable](#editable) -- [enabled](#enabled) -- [visible](#visible) -- [selected](#selected) -- [text](#text) +* [editable](#editable) +* [enabled](#enabled) +* [visible](#visible) +* [selected](#selected) +* [text](#text) ## Reference @@ -41,53 +41,53 @@ render(); Whether the user can enter their own custom text in addition to the drop down menu. | **Type** | **Required** | **Default** | -| --- | --- | --- | -| bool | No | false | +| -------- | ------------ | ----------- | +| bool | No | false | ### enabled Whether the Picker is enabled. | **Type** | **Required** | **Default** | -| --- | --- | --- | -| bool | No | true | +| -------- | ------------ | ----------- | +| bool | No | true | ### visible Whether the Picker can be seen. | **Type** | **Required** | **Default** | -| --- | --- | --- | -| bool | No | true | +| -------- | ------------ | ----------- | +| bool | No | true | ### selected -What element is selected if the picker *is not* editable. +The index of the element that is selected if the picker _is not_ editable. | **Type** | **Required** | **Editable** | **Default** | -| --- | --- | --- | --- | -| bool | No | No | -1 | +| -------- | ------------ | ------------ | ----------- | +| number | No | No | -1 | ### text -What text is selected/typed if the picker *is* editable. +What text is selected/typed if the picker _is_ editable. | **Type** | **Required** | **Editable** | **Default** | -| --- | --- | --- | --- | -| bool | No | Yes | '' | +| -------- | ------------ | ------------ | ----------- | +| string | No | Yes | '' | ### onSelect -When a *non-editable* Picker is changed. The current selection is passed as an argument. +When a _non-editable_ Picker is changed. The current selection index is passed as an argument. -| **Type** | **Required** | **Editable** | -| --- | --- | --- | -| function(selection) | No | No | +| **Type** | **Required** | **Editable** | +| ------------------------ | ------------ | ------------ | +| function(selectionIndex) | No | No | ### onChange -When an *editable* Picker is changed. The current text is passed as an argument. +When an _editable_ Picker is changed. The current text is passed as an argument. -| **Type** | **Required** | **Editable** | -| --- | --- | --- | -| function(text) | No | Yes | \ No newline at end of file +| **Type** | **Required** | **Editable** | +| -------------- | ------------ | ------------ | +| function(text) | No | Yes |