Skip to content

V7_KeyboardAccessoryView - remove 'iOSScrollBehavior' prop #2469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions lib/components/Keyboard/KeyboardInput/KeyboardAccessoryView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
BackHandler,
LayoutChangeEvent
} from 'react-native';
import {LogService} from '../../../../src/services';
import KeyboardTrackingView, {KeyboardTrackingViewProps} from '../KeyboardTracking/KeyboardTrackingView';
import CustomKeyboardView from './CustomKeyboardView';
import KeyboardUtils from './utils/KeyboardUtils';
Expand Down Expand Up @@ -54,12 +53,6 @@ export type KeyboardAccessoryViewProps = kbTrackingViewProps & {
* Callback that will be called once the keyboard has been closed
*/
onKeyboardResigned?: () => void;
/**
* @deprecated
* Please use 'scrollBehavior' prop instead
* The scrolling behavior (use KeyboardAccessoryView.scrollBehaviors.NONE | SCROLL_TO_BOTTOM_INVERTED_ONLY | FIXED_OFFSET)
*/
iOSScrollBehavior?: number;
children?: React.ReactChild;
};

Expand All @@ -69,10 +62,6 @@ export type KeyboardAccessoryViewProps = kbTrackingViewProps & {
* @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/KeyboardAccessoryView/KeyboardAccessoryView.gif?raw=true
*/
class KeyboardAccessoryView extends Component<KeyboardAccessoryViewProps> {
/**
* @deprecated Please use KeyboardAccessoryView.scrollBehaviors instead
*/
static iosScrollBehaviors = KeyboardTrackingView.scrollBehaviors; //TODO: remove on V7
static scrollBehaviors = KeyboardTrackingView.scrollBehaviors;

static defaultProps = {
Expand All @@ -99,12 +88,6 @@ class KeyboardAccessoryView extends Component<KeyboardAccessoryViewProps> {

this.registerForKeyboardResignedEvent();
this.registerAndroidBackHandler();

if (props.iOSScrollBehavior) {
LogService.warn(`The 'Keyboard.KeyboardAccessoryView' component's prop 'iOSScrollBehavior' is deprecated.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LogService can be removed from the imports

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that was the issue that failed my build... Thanks

Please use 'scrollBehavior' prop instead and pass it 'Keyboard.KeyboardAccessoryView.scrollBehaviors'
('Keyboard.KeyboardAccessoryView.iosScrollBehaviors' enum is deprecated).`);
}
}

componentWillUnmount() {
Expand Down Expand Up @@ -193,14 +176,13 @@ class KeyboardAccessoryView extends Component<KeyboardAccessoryViewProps> {
onItemSelected,
onRequestShowKeyboard,
scrollBehavior,
iOSScrollBehavior,
...others
} = this.props;

return (
<KeyboardTrackingView
{...others}
scrollBehavior={IsIOS ? iOSScrollBehavior || scrollBehavior : undefined}
scrollBehavior={scrollBehavior}
ref={(r: any) => (this.trackingViewRef = r)}
style={styles.trackingToolbarContainer}
onLayout={this.onContainerComponentHeightChanged}
Expand Down