Skip to content

Commit f0795f6

Browse files
authored
Merge pull request #164 from mobily/keyboardavoidingview-component
Add `KeyboardAvoidingView` bindings (component)
2 parents f997f3d + 103f5d3 commit f0795f6

File tree

4 files changed

+170
-1
lines changed

4 files changed

+170
-1
lines changed

STATUS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- [x] FlatList
1111
- [x] Image
1212
- [x] Image Background
13-
- [ ] KeyboardAvoidingView
13+
- [x] KeyboardAvoidingView
1414
- [ ] ListView
1515
- [ ] MapView
1616
- [x] Modal

lib/js/src/components/keyboardAvoidingView.js

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[@bs.deriving jsConverter]
2+
type behavior = [ | `height | `position | `padding];
3+
4+
[@bs.module "react-native"]
5+
external keyboardAvoidingView : ReasonReact.reactClass =
6+
"KeyboardAvoidingView";
7+
8+
let make =
9+
(
10+
~accessibilityLabel=?,
11+
~accessible=?,
12+
~hitSlop=?,
13+
~onAccessibilityTap=?,
14+
~onLayout=?,
15+
~onMagicTap=?,
16+
~responderHandlers=?,
17+
~pointerEvents=?,
18+
~removeClippedSubviews=?,
19+
~style=?,
20+
~testID=?,
21+
~accessibilityComponentType=?,
22+
~accessibilityLiveRegion=?,
23+
~collapsable=?,
24+
~importantForAccessibility=?,
25+
~needsOffscreenAlphaCompositing=?,
26+
~renderToHardwareTextureAndroid=?,
27+
~accessibilityTraits=?,
28+
~accessibilityViewIsModal=?,
29+
~shouldRasterizeIOS=?,
30+
~keyboardVerticalOffset=?,
31+
~behavior=?,
32+
~contentContainerStyle=?,
33+
) =>
34+
ReasonReact.wrapJsForReason(
35+
~reactClass=keyboardAvoidingView,
36+
~props=
37+
Js.Undefined.(
38+
Props.extendView(
39+
~accessibilityLabel?,
40+
~accessible?,
41+
~hitSlop?,
42+
~onAccessibilityTap?,
43+
~onLayout?,
44+
~onMagicTap?,
45+
~responderHandlers?,
46+
~pointerEvents?,
47+
~removeClippedSubviews?,
48+
~style?,
49+
~testID?,
50+
~accessibilityComponentType?,
51+
~accessibilityLiveRegion?,
52+
~collapsable?,
53+
~importantForAccessibility?,
54+
~needsOffscreenAlphaCompositing?,
55+
~renderToHardwareTextureAndroid?,
56+
~accessibilityTraits?,
57+
~accessibilityViewIsModal?,
58+
~shouldRasterizeIOS?,
59+
{
60+
"keyboardVerticalOffset": fromOption(keyboardVerticalOffset),
61+
"behavior":
62+
fromOption(UtilsRN.option_map(behaviorToJs, behavior)),
63+
"contentContainerStyle": fromOption(contentContainerStyle),
64+
},
65+
)
66+
),
67+
);
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
let make:
2+
(
3+
~accessibilityLabel: string=?,
4+
~accessible: bool=?,
5+
~hitSlop: Types.insets=?,
6+
~onAccessibilityTap: unit => unit=?,
7+
~onLayout: RNEvent.NativeLayoutEvent.t => unit=?,
8+
~onMagicTap: unit => unit=?,
9+
~responderHandlers: Types.touchResponderHandlers=?,
10+
~pointerEvents: [ | `auto | `boxNone | `boxOnly | `none]=?,
11+
~removeClippedSubviews: bool=?,
12+
~style: Style.t=?,
13+
~testID: string=?,
14+
~accessibilityComponentType: [
15+
| `button
16+
| `none
17+
| `radiobutton_checked
18+
| `radiobutton_unchecked
19+
]
20+
=?,
21+
~accessibilityLiveRegion: [ | `assertive | `none | `polite]=?,
22+
~collapsable: bool=?,
23+
~importantForAccessibility: [ | `auto | `no | `noHideDescendants | `yes]=?,
24+
~needsOffscreenAlphaCompositing: bool=?,
25+
~renderToHardwareTextureAndroid: bool=?,
26+
~accessibilityTraits: list(
27+
[
28+
| `adjustable
29+
| `allowsDirectInteraction
30+
| `button
31+
| `disabled
32+
| `frequentUpdates
33+
| `header
34+
| `image
35+
| `key
36+
| `link
37+
| `none
38+
| `pageTurn
39+
| `plays
40+
| `search
41+
| `selected
42+
| `startsMedia
43+
| `summary
44+
| `text
45+
],
46+
)
47+
=?,
48+
~accessibilityViewIsModal: bool=?,
49+
~shouldRasterizeIOS: bool=?,
50+
~keyboardVerticalOffset: float=?,
51+
~behavior: [ | `height | `position | `padding]=?,
52+
~contentContainerStyle: Style.t=?,
53+
array(ReasonReact.reactElement)
54+
) =>
55+
ReasonReact.component(
56+
ReasonReact.stateless,
57+
ReasonReact.noRetainedProps,
58+
unit,
59+
);

0 commit comments

Comments
 (0)