Skip to content

Commit 85b850d

Browse files
committed
KeyboardAccessotyView - removing duplicated props and extending selected KeyboardTrackingViewProps
1 parent cc2f668 commit 85b850d

File tree

2 files changed

+4
-109
lines changed

2 files changed

+4
-109
lines changed

lib/components/Keyboard/KeyboardInput/KeyboardAccessoryView.tsx

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
BackHandler,
1010
LayoutChangeEvent
1111
} from 'react-native';
12-
import KeyboardTrackingView from '../KeyboardTracking/KeyboardTrackingView';
12+
import KeyboardTrackingView, {KeyboardTrackingViewProps} from '../KeyboardTracking/KeyboardTrackingView';
1313
import CustomKeyboardView from './CustomKeyboardView';
1414
import KeyboardUtils from './utils/KeyboardUtils';
1515

@@ -25,7 +25,9 @@ const IOS_SCROLL_BEHAVIORS = IsIOS
2525
}
2626
: {};
2727

28-
export type KeyboardAccessoryViewProps = {
28+
type kbTrackingViewProps = Pick<KeyboardTrackingViewProps, 'revealKeyboardInteractive' | 'manageScrollView' | 'requiresSameParentToManageScrollView' | 'allowHitsOutsideBounds' | 'addBottomView' | 'bottomViewColor' | 'useSafeArea' | 'usesBottomTabs'>;
29+
30+
export type KeyboardAccessoryViewProps = kbTrackingViewProps & {
2931
/**
3032
* Content to be rendered above the keyboard
3133
*/
@@ -67,57 +69,6 @@ export type KeyboardAccessoryViewProps = {
6769
* default: FIXED_OFFSET
6870
*/
6971
iOSScrollBehavior?: number;
70-
/**
71-
* iOS only.
72-
* Show the keyboard on a negative scroll
73-
* default: false
74-
*/
75-
revealKeyboardInteractive?: boolean;
76-
/**
77-
* iOS only.
78-
* Set to false to turn off inset management and manage it yourself
79-
* default: true
80-
*/
81-
manageScrollView?: boolean;
82-
/**
83-
* iOS only.
84-
* Set to true manageScrollView is set to true and still does not work,
85-
* it means that the ScrollView found is the wrong one and you'll have
86-
* to have the KeyboardAccessoryView and the ScrollView as siblings
87-
* and set this to true
88-
* default: false
89-
*/
90-
requiresSameParentToManageScrollView?: boolean;
91-
/**
92-
* iOS only.
93-
* Allow hitting sub-views that are placed beyond the view bounds
94-
* default: false
95-
*/
96-
allowHitsOutsideBounds?: boolean;
97-
/**
98-
* iOS only.
99-
* Add a SafeArea view beneath the KeyboardAccessoryView
100-
* default: false
101-
*/
102-
addBottomView?: boolean;
103-
/**
104-
* iOS only.
105-
* The bottom view's color
106-
* default: 'white'
107-
*/
108-
bottomViewColor?: string;
109-
/**
110-
* iOS only.
111-
* Whether or not to handle SafeArea
112-
* default: true
113-
*/
114-
useSafeArea?: boolean;
115-
/**
116-
* iOS only.
117-
* Whether or not to include bottom tab bat inset
118-
* default: false
119-
*/
120-
usesBottomTabs?: boolean;
12172
children?: React.ReactChild;
12273
};
12374

lib/components/Keyboard/KeyboardInput/keyboardAccessoryView.api.json

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -49,62 +49,6 @@
4949
"type": "number",
5050
"description": "The scrolling behavior, use KeyboardAccessoryView.iosScrollBehaviors.X where X is:\nNONE, SCROLL_TO_BOTTOM_INVERTED_ONLY or FIXED_OFFSET\niOS only.",
5151
"default": "FIXED_OFFSET"
52-
},
53-
{
54-
"name": "revealKeyboardInteractive",
55-
"type": "boolean",
56-
"description": "Show the keyboard on a negative scroll\niOS only.",
57-
"note": "KeyboardTrackingView prop. iOS only",
58-
"default": "false"
59-
},
60-
{
61-
"name": "manageScrollView",
62-
"type": "boolean",
63-
"description": "Set to false to turn off inset management and manage it yourself\niOS only.",
64-
"note": "KeyboardTrackingView prop. iOS only",
65-
"default": "true"
66-
},
67-
{
68-
"name": "requiresSameParentToManageScrollView",
69-
"type": "boolean",
70-
"description": "Set to true manageScrollView is set to true and still does not work,\nit means that the ScrollView found is the wrong one and you'll have\nto have the KeyboardAccessoryView and the ScrollView as siblings\nand set this to true\niOS only.",
71-
"note": "KeyboardTrackingView prop. iOS only",
72-
"default": "false"
73-
},
74-
{
75-
"name": "allowHitsOutsideBounds",
76-
"type": "boolean",
77-
"description": "Allow hitting sub-views that are placed beyond the view bounds\niOS only.",
78-
"note": "KeyboardTrackingView prop. iOS only",
79-
"default": "false"
80-
},
81-
{
82-
"name": "addBottomView",
83-
"type": "boolean",
84-
"description": "Add a view beneath the KeyboardAccessoryView\niOS only.",
85-
"note": "KeyboardTrackingView prop. iOS only",
86-
"default": "false"
87-
},
88-
{
89-
"name": "bottomViewColor",
90-
"type": "string",
91-
"description": "The bottom view's color\niOS only.",
92-
"note": "KeyboardTrackingView prop. iOS only",
93-
"default": "white"
94-
},
95-
{
96-
"name": "useSafeArea",
97-
"type": "boolean",
98-
"description": "Whether or not to handle SafeArea\niOS only.",
99-
"note": "KeyboardTrackingView prop. iOS only",
100-
"default": "true"
101-
},
102-
{
103-
"name": "usesBottomTabs",
104-
"type": "boolean",
105-
"description": "Whether or not to include bottom tab bar inset\niOS only.",
106-
"note": "KeyboardTrackingView prop. iOS only",
107-
"default": "false"
10852
}
10953
],
11054
"snippet": [

0 commit comments

Comments
 (0)