Skip to content

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

Conversation

Inbal-Tish
Copy link
Collaborator

Description

KeyboardAccessoryView - 'iosScrollBehavior' prop deprecation

Changelog

KeyboardAccessoryView - 'iosScrollBehavior' prop deprecation

@Inbal-Tish Inbal-Tish requested a review from M-i-k-e-l April 27, 2022 08:55
@Inbal-Tish Inbal-Tish changed the base branch from master to feat/KeyboardTrackingView_bottomViewColor April 27, 2022 09:01

static defaultProps = {
iOSScrollBehavior: -1,
Copy link
Collaborator

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?

Copy link
Collaborator Author

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)
Copy link
Collaborator

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.

Copy link
Collaborator Author

@Inbal-Tish Inbal-Tish Apr 27, 2022

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
Copy link
Collaborator

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});

Copy link
Collaborator Author

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)",
Copy link
Collaborator

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

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, keeping the static. fixed.

@Inbal-Tish Inbal-Tish merged commit 1ba4dac into feat/KeyboardTrackingView_bottomViewColor Apr 28, 2022
M-i-k-e-l pushed a commit that referenced this pull request Apr 28, 2022
* 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'
@Inbal-Tish Inbal-Tish deleted the infra/KeyboardAccessoryView_iOSScrollBehavior_deprecation branch May 4, 2022 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants