-
Notifications
You must be signed in to change notification settings - Fork 734
KeyboardAccessoryView - 'iosScrollBehavior' prop deprecation #2016
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
KeyboardAccessoryView - 'iosScrollBehavior' prop deprecation #2016
Conversation
|
||
static defaultProps = { | ||
iOSScrollBehavior: -1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not change this to KeyboardAccessoryView.iosScrollBehaviors.FIXED_OFFSET
instead of adding it bellow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I don't want to have a default to 'iOSScrollBehavior' prop so I can use the 'scrollBehavior' prop instead (that holds the default)
* NONE, SCROLL_TO_BOTTOM_INVERTED_ONLY or FIXED_OFFSET | ||
* default: FIXED_OFFSET | ||
* @deprecated | ||
* Please use 'scrollBehavior' prop instead and take values from 'KeyboardTrackingView.scrollBehaviors' (instead of KeyboardAccessoryView.iosScrollBehaviors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should still be KeyboardAccessoryView.iosScrollBehaviors
, so the user will not need to import KeyboardTrackingView
as well.
But probably change this to scrollBehaviors
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I meant to keep the static for that reason. The comment is wrong, I'll fix this
@@ -78,10 +67,10 @@ 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> { | |||
static iosScrollBehaviors = IOS_SCROLL_BEHAVIORS; | |||
// @ts-expect-error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can fix this by changing the export in KeyboardTrackingView
to:
export default KeyboardTrackingView as (typeof KeyboardTrackingView & {scrollBehaviors: typeof SCROLL_BEHAVIORS});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
@@ -47,8 +47,9 @@ | |||
{ | |||
"name": "iOSScrollBehavior", | |||
"type": "number", | |||
"description": "The scrolling behavior, use KeyboardAccessoryView.iosScrollBehaviors.X where X is:\nNONE, SCROLL_TO_BOTTOM_INVERTED_ONLY or FIXED_OFFSET\niOS only.", | |||
"default": "FIXED_OFFSET" | |||
"description": "The scrolling behavior. DEPRECATED: Use 'scrollBehavior' prop instead and take values from 'KeyboardTrackingView.scrollBehaviors' (instead of KeyboardAccessoryView.iosScrollBehaviors)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to change as well if we decide to keep the static on KeyboardAccessoryView
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, keeping the static. fixed.
* KeyboardTrackingView - add 'bottomViewColor' prop * fix master merge * Moving back to UIColor * fix * KeyboardAccessoryView - use others instead of passing each prop literally. * Updating lib version * fix api snippets * Fix example screen * KeyboardAccessotyView - removing duplicated props and extending selected KeyboardTrackingViewProps * KeyboardAccessoryView - 'iosScrollBehavior' prop deprecation (#2016) * KeyboardAccessoryView - iOSScrollBehavior prop deprecation * api fix * pr comments fixes * fix snippet * pr comments fixin'
Description
KeyboardAccessoryView - 'iosScrollBehavior' prop deprecation
Changelog
KeyboardAccessoryView - 'iosScrollBehavior' prop deprecation