Skip to content

Move from KeyboardAwareListView to KeyboardAwareFlatList #960

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 8 commits into from
Oct 21, 2020

Conversation

M-i-k-e-l
Copy link
Collaborator

Description

KeyboardAwareFlatList - add new type to the KeyboardAware view and deprecate KeyboardAwareListView
I think we need to do some more refactoring around this (fix warnings and code duplications), but maybe in another task\PR.

Changelog

Move from KeyboardAwareListView to KeyboardAwareFlatList

onLayout={(layoutEvent) => {
this._onKeyboardAwareViewLayout(layoutEvent.nativeEvent.layout);
}}
onScroll={(event) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same for the onScroll callback.
maybe you can unify the logic in KeyboardAwareBase.
Anyway, avoid passing inline callbacks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see you didn't update KeyboardAwareListView with the same fixes..
Is that because we're deprecating the component ?

Copy link
Collaborator Author

@M-i-k-e-l M-i-k-e-l Oct 20, 2020

Choose a reason for hiding this comment

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

You are right, it should be aligned even if it should not be used, fixed

@@ -81,6 +81,9 @@ export default {
get KeyboardAwareListView() {
return require('./components/KeyboardAwareScrollView').KeyboardAwareListView;
},
get KeyboardAwareFlatList() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Now I notice we export KeyboardAwareFlatList, KeyboardAwareScroll and KeyboardAwareListView as standalone components and not as part of the Keyboard group.
Why is that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We did not start migrating all of the OS libs, only react-native-keyboard-input and react-native-keyboard-tracking-view

Copy link
Collaborator

Choose a reason for hiding this comment

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

But still?
Why not include them in the keyboard namespace?
Which libraries we have left?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I fear that someone will start using it, and I'm not sure there won't be conflicts (in native code).
We're using the Keyboard as is in the private lib and we're not exporting the KeyboardAware part (which is installed from the original by the engine).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, these are the ones I remember:
https://github.com/wix/react-native-keyboard-aware-scrollview
https://github.com/wix/react-native-autogrow-textinput

I think I left my notebook with the notes in the office :D

Copy link
Collaborator

Choose a reason for hiding this comment

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

I fear that someone will start using it, and I'm not sure there won't be conflicts (in native code).
We're using the Keyboard as is in the private lib and we're not exporting the KeyboardAware part (which is installed from the original by the engine).

Im a little confused about this one..
let's have a quick talk about when you have time..

@M-i-k-e-l M-i-k-e-l requested a review from ethanshar October 14, 2020 17:01
@ethanshar ethanshar removed their request for review October 20, 2020 04:42
@M-i-k-e-l M-i-k-e-l requested a review from ethanshar October 20, 2020 08:29
@ethanshar ethanshar merged commit 544d75e into master Oct 21, 2020
M-i-k-e-l added a commit that referenced this pull request Oct 25, 2020
* master:
  Fix missed issue with migrating Picker API - PickerItem needs to retrieve the correct value format
  Add Slider testID (#999)
  Remove declaration of ref type on TouchableOpacity
  convert three digit hex to six (#976)
  Fix/text field right icon alignment (#997)
  migrate Switch to TS (#991)
  Move from KeyboardAwareListView to KeyboardAwareFlatList (#960)
  Update constants typings
  migrate ActionBar to TS (#987)
  Do not notify the user onPageChange for the fake page (fix autoscroll on Android bug) (#994)
  Add progress type for ProgressBarProps (#996)
  Fix generated JS files to include propTypes (#995)

# Conflicts:
#	generatedTypes/components/touchableOpacity/index.d.ts
@M-i-k-e-l M-i-k-e-l deleted the feat/add-keyboard-aware-flat-list branch January 25, 2021 09:03
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