Skip to content

Commit f1d04e6

Browse files
committed
Updated TextInput documentation for clarity. Cleaned up spacing in some of the other docs as well.
1 parent 17c6567 commit f1d04e6

File tree

9 files changed

+67
-42
lines changed

9 files changed

+67
-42
lines changed

docs/docs/apis/app.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ enum AppActivationState {
2222
// App is inactive (not actively running)
2323
Inactive = 3,
2424

25-
// iOS specific activation state for extensions implemented with react-native
25+
// iOS specific activation state for extensions implemented
26+
// with react-native
2627
Extension = 4
2728
}
2829
```

docs/docs/apis/popup.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ interface PopupOptions {
3030
renderPopup: (anchorPosition: PopupPosition, anchorOffset: number,
3131
popupWidth: number, popupHeight: number) => ReactNode;
3232

33-
// Returns a mounted component instance that controls the triggering of the popup.
34-
// In the majority of cases, "anchor" of popup has handlers to control when the popup
35-
// will be seen and this function is not required. In a few cases, where anchor is
36-
// not the same as the whole component that triggers when the popup wil be seen,
37-
// this can be used. For instance, a button combined with a chevron icon, which on
38-
// click triggers a popup below the chevron icon. In this example,
39-
// getElementTriggeringPopup() can return the container with button and chevron icon.
33+
// Returns a mounted component instance that controls the triggering
34+
// of the popup. In the majority of cases, "anchor" of popup has
35+
// handlers to control when the popup will be seen and this function
36+
// is not required. In a few cases, where anchor is not the same as
37+
// the whole component that triggers when the popup wil be seen,
38+
// this can be used. For instance, a button combined with a chevron
39+
// icon, which on click triggers a popup below the chevron icon. In
40+
// this example, getElementTriggeringPopup() can return the container
41+
// with button and chevron icon.
4042
getElementTriggeringPopup?: () => React.Component<any, any>;
4143

4244
// Called when the popup is dismissed.
@@ -51,8 +53,8 @@ interface PopupOptions {
5153
// In this mode only the first position priority will be used.
5254
useInnerPositioning?: boolean;
5355

54-
// On pressed handler to notify whoever wanted to create the popup that its
55-
// anchor has been pressed.
56+
// On pressed handler to notify whoever wanted to create the popup
57+
// that its anchor has been pressed.
5658
// IMPORTANT NOTE: This handler may be called when the component is
5759
// already unmounted as it uses a time delay accommodate
5860
// fade-out animations.
@@ -74,7 +76,8 @@ interface PopupOptions {
7476
## Methods
7577

7678
``` javascript
77-
// Dismisses an already-displayed popup after a specified number of milliseconds
79+
// Dismisses an already-displayed popup after a specified number
80+
// of milliseconds
7881
autoDismiss(popupId: string, dismissDelay: number = 0): void;
7982

8083
// Dismisses an already-displayed popup immediately

docs/docs/components/button.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ accessibilityHidden: boolean = false;
2626
accessibilityTraits: AccessibilityTrait | AccessibilityTrait[] = undefined;
2727

2828
// Region for accessibility mechanisms
29-
accessibilityLiveRegion: AccessibilityLiveRegion = undefined; // Android and web only
29+
accessibilityLiveRegion: AccessibilityLiveRegion =
30+
undefined; // Android and web only
3031

3132
// Expose the element and/or its children as accessible to Screen readers
3233
importantForAccessibility?: ImportantForAccessibility = ImportantForAccessibility.yes;
@@ -37,7 +38,8 @@ delayLongPress: number = 1000;
3738
// If disabled, touch and mouse input events are ignored
3839
disabled: boolean = false;
3940

40-
// Called when VoiceOver is on and the user double tapped to activate a control
41+
// Called when VoiceOver is on and the user double tapped to
42+
// activate a control
4143
onAccessibilityTapIOS: (e: SyntheticEvent) => void; // iOS Only
4244

4345
// Called when the user has pressed and held for a specified duration
@@ -47,13 +49,15 @@ onLongPress: (e: SyntheticEvent) => void;
4749
onHoverStart: (e: SyntheticEvent) => void;
4850
onHoverEnd: (e: SyntheticEvent) => void;
4951

50-
// Called when the touch or mouse button is released within the bounds of the view and the press has not been canceled
52+
// Called when the touch or mouse button is released within the
53+
// bounds of the view and the press has not been canceled
5154
onPress: (e: SyntheticEvent) => void;
5255

5356
// Called when touch is initiated or mouse button is pressed
5457
onPressIn: (e: SyntheticEvent) => void;
5558

56-
// Called when touch or the mouse button is released or the user&apos;s finger or mouse cursor is no longer over the view
59+
// Called when touch or the mouse button is released or the
60+
// user's finger or mouse cursor is no longer over the view
5761
onPressOut: (e: SyntheticEvent) => void;
5862

5963
// Rasterize contents using offscreen bitmap (perf optimization)

docs/docs/components/gestureview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ preferredPan: PreferredPanGesture = undefined; // Horizontal or vertical
3535
// pan is recognized? Default is 10. Can be any value > 0.
3636
panPixelThreshold: number = undefined;
3737

38-
// Something else wants to become responder. Should this view release the responder?
39-
// Setting true allows release
38+
// Something else wants to become responder. Should this view
39+
// release the responder? Setting true allows release.
4040
releaseOnRequest: boolean = false;
4141

4242
// Alternate text for screen readers.

docs/docs/components/scrollview.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ next: components/text
99

1010
Like a View, this component is a container for other components. However, it supports scrolling (panning) and zooming so it is possible to view larger contents.
1111

12-
ScrollViews must have a bounded height (or width, if it scrolls horizontally) since its children are of unbounded height (or width). To bound the dimensions of a ScrollView, either set the height/width directly or make sure that its parent&apos;s height/width is bounded.
12+
ScrollViews must have a bounded height (or width, if it scrolls horizontally) since its children are of unbounded height (or width). To bound the dimensions of a ScrollView, either set the height/width directly or make sure that its parent's height/width is bounded.
1313

1414
## Props
1515
``` javascript
@@ -27,7 +27,8 @@ justifyEnd: boolean = false;
2727
// When the user scrolls the view, how should the on-screen keyboard react?
2828
keyboardDismissMode: 'none' | 'interactive' | 'on-drag'; // Native only
2929

30-
// Should the on-screen keyboard remain visible when the user taps the scroll view?
30+
// Should the on-screen keyboard remain visible when the user taps
31+
// the scroll view?
3132
keyboardShouldPersistTaps: boolean = false; // Native only
3233

3334
// Maximum scale factor

docs/docs/components/text.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ accessibilityHidden: boolean = false;
2727
accessibilityTraits: AccessibilityTrait | AccessibilityTrait[] = undefined;
2828

2929
// Region for accessibility mechanisms
30-
accessibilityLiveRegion: AccessibilityLiveRegion = undefined; // Android and web only
30+
accessibilityLiveRegion: AccessibilityLiveRegion =
31+
undefined; // Android and web only
3132

3233
// Should fonts be scaled according to system setting?
3334
allowFontScaling: boolean = true; // Android and iOS only

docs/docs/components/textinput.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ next: components/view
99

1010
This component provides basic text input capabilities.
1111

12+
It can be used in one of two modes. In the first mode, the contents of the text input are static and are specified by the `value` prop. Any attempt to modify the value will result in `onChangeText`, which allows the owning component to re-render with an updated `value`. In the second mode, `value` is unspecified, and the text input value is allowed to be modified as long as it remains mounted. In this mode, the caller can specify an optional `defaultValue` prop to specify the initial value.
13+
1214
## Props
1315
In addition to the [common accessibility props](/reactxp/docs/accessibility.html), the following props are supported.
1416

@@ -43,8 +45,8 @@ keyboardAppearance: 'default' | 'light' | 'dark';
4345
// On-screen keyboard type to display
4446
keyboardType: 'default' | 'numeric' | 'email-address' | 'number-pad';
4547

46-
// Should the scale multiplier be capped when allowFontScaling is set to true?
47-
// Possible values include the following:
48+
// Should the scale multiplier be capped when allowFontScaling is
49+
// set to true? Possible values include the following:
4850
// null/undefined (default) - inheret from parent/global default
4951
// 0 - no max
5052
// >= 1 - sets the maxContentSizeMultiplier of this node to this value
@@ -78,7 +80,8 @@ onScroll: (newScrollTop: number, newScrollLeft: number) => void = undefined;
7880
// Called when the selection range or insertion point location changes
7981
onSelectionChange: (start: number, end: number) => void = undefined;
8082

81-
// Called when the text input submit button is pressed; invalid if multiline is true
83+
// Called when the text input submit button is pressed; invalid if
84+
// multiline is true
8285
onSubmitEditing: () => void = undefined;
8386

8487
// Placeholder text to dislpay when input is empty
@@ -103,7 +106,8 @@ style: TextInputStyleRuleSet | TextInputStyleRuleSet[] = [];
103106
textAlign: 'auto' | 'left' | 'right' | 'center' | 'justify';
104107

105108

106-
// If defined, the control value is forced to match this value; if undefined, control value can be modified by the user
109+
// If defined, the control value is forced to match this value;
110+
// if undefined, control value can be modified by the user
107111
value: string = undefined;
108112
```
109113

@@ -121,11 +125,13 @@ value: string = undefined;
121125
// Forces the control to give up focus
122126
blur(): void;
123127

124-
// Gives the control focus. For mobile, use setAccessibilityFocus() for setting screen reader focus
128+
// Gives the control focus. For mobile, use setAccessibilityFocus()
129+
// for setting screen reader focus
125130
focus(): void;
126131

127132
// Gives the control accessibility-only focus
128-
// E.g. screen reader focus is needed, but popping up of native keyboard is undesirable
133+
// E.g. screen reader focus is needed, but popping up of native
134+
// keyboard is undesirable
129135
setAccessibilityFocus(): void;
130136

131137
// Does control currently have focus?

docs/docs/components/view.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ accessibilityHidden: boolean = false;
2424
accessibilityTraits: AccessibilityTrait | AccessibilityTrait[] = undefined;
2525

2626
// Region for accessibility mechanisms
27-
accessibilityLiveRegion: AccessibilityLiveRegion = undefined; // Android and web only
27+
accessibilityLiveRegion: AccessibilityLiveRegion =
28+
undefined; // Android and web only
2829

2930
// Expose the element and/or its children as accessible to Screen readers
3031
importantForAccessibility?: ImportantForAccessibility = Auto;
@@ -90,18 +91,23 @@ onPress: (e: SyntheticEvent) => void = undefined;
9091

9192
// Touch-specific Events
9293
onLongPress: (e: SyntheticEvent) => void = undefined;
93-
onMoveShouldSetResponder: (e: React.SyntheticEvent) => boolean = undefined;
94-
onMoveShouldSetResponderCapture: (e: React.SyntheticEvent) => boolean = undefined;
94+
onMoveShouldSetResponder: (e: React.SyntheticEvent) => boolean =
95+
undefined;
96+
onMoveShouldSetResponderCapture: (e: React.SyntheticEvent) => boolean =
97+
undefined;
9598
onResponderGrant: (e: React.SyntheticEvent) => void = undefined;
9699
onResponderReject: (e: React.SyntheticEvent) => void = undefined;
97100
onResponderRelease: (e: React.SyntheticEvent) => void = undefined;
98101
onResponderStart: (e: React.TouchEvent) => void = undefined;
99102
onResponderMove: (e: React.TouchEvent) => void = undefined;
100103
onResponderEnd: (e: React.TouchEvent) => void = undefined;
101104
onResponderTerminate: (e: React.SyntheticEvent) => void = undefined;
102-
onResponderTerminationRequest: (e: React.SyntheticEvent) => boolean = undefined;
103-
onStartShouldSetResponder: (e: React.SyntheticEvent) => boolean = undefined;
104-
onStartShouldSetResponderCapture: (e: React.SyntheticEvent) => boolean = undefined;
105+
onResponderTerminationRequest: (e: React.SyntheticEvent) => boolean =
106+
undefined;
107+
onStartShouldSetResponder: (e: React.SyntheticEvent) => boolean =
108+
undefined;
109+
onStartShouldSetResponderCapture: (e: React.SyntheticEvent) => boolean =
110+
undefined;
105111

106112
// Other Events
107113
onLayout: (e: ViewOnLayoutEvent) => void = undefined;

docs/docs/extensions/virtuallistview.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ It supports a special mode where items are re-rendered only if the corresponding
3232

3333
## Example
3434
``` javascript
35-
import { VirtualListView, VirtualListViewItemInfo } from 'reactxp-virtuallistview';
35+
import { VirtualListView, VirtualListViewItemInfo }
36+
from 'reactxp-virtuallistview';
3637

3738
// Extend VirtualListViewItemInfo to include display text
3839
interface FruitListItemInfo extends VirtualListViewItemInfo {
@@ -86,7 +87,8 @@ class FruitListView extends RX.Component<null, FruitListState> {
8687
private _renderItem(item: FruitListItemInfo, hasFocus?: boolean) {
8788
const viewStyle = RX.Styles.createViewStyle({
8889
height: item.height,
89-
backgroundColor: item.template === _headerItemTemplate ? '#ddd' : '#fff',
90+
backgroundColor: item.template === _headerItemTemplate ?
91+
'#ddd' : '#fff',
9092
alignItems: 'center'
9193
}, false);
9294

@@ -145,25 +147,26 @@ interface VirtualListViewItemInfo {
145147
// Optional padding around the scrolling content within the list.
146148
padding?: number;
147149

148-
// If true, allows each item to overflow its visible cell boundaries; by default,
149-
// item contents are clipped to cell boundaries.
150+
// If true, allows each item to overflow its visible cell boundaries;
151+
// by default, item contents are clipped to cell boundaries.
150152
showOverflow?: boolean;
151153

152154
// Should the list animate additions, removals and moves within the list?
153155
animateChanges?: boolean;
154156

155-
// By default, VirtualListView re-renders every item during the render. Setting
156-
// this flag to true allows the list view to re-render only items from itemList
157-
// whose descriptor has changed, thus avoiding unnecessary rendering. It uses
158-
// _.isEqual to perform this check. In this mode, renderItem should not depend
159-
// on any external state, only on VirtualListViewItemInfo, to render item.
157+
// By default, VirtualListView re-renders every item during the render.
158+
// Setting this flag to true allows the list view to re-render only
159+
// items from itemList whose descriptor has changed, thus avoiding
160+
// unnecessary rendering. It uses _.isEqual to perform this check. In
161+
// this mode, renderItem should not depend on any external state, only
162+
// on VirtualListViewItemInfo, to render item.
160163
skipRenderIfItemUnchanged?: boolean;
161164

162165
// Pass-through properties for scroll view.
163166
keyboardDismissMode?: 'none' | 'interactive' | 'on-drag';
164167
keyboardShouldPersistTaps?: boolean;
165168
disableScrolling?: boolean;
166-
scrollsToTop?: boolean; // iOS only, scroll to top when user taps on status bar
169+
scrollsToTop?: boolean; // iOS only, scroll to top on status bar tap
167170
disableBouncing?: boolean; // iOS only, bounce override
168171
scrollIndicatorInsets?: { top: number, left: number,
169172
bottom: number, right: number }; // iOS only

0 commit comments

Comments
 (0)