Skip to content
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

[Sheets] [Pt. 13] Keyboard handling #5586

Merged
merged 73 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
5a98ea6
Include ghost hook to statically export fonts (#5553)
estrattonbailey Oct 1, 2024
801cb62
close all dialogs
haileyok Oct 1, 2024
a17892d
remove a bunch of to-be-useless stuff
haileyok Oct 1, 2024
3971254
remove `Dialog.Handle` uses
haileyok Oct 1, 2024
64f849b
rm handle component
haileyok Oct 1, 2024
6dec099
type
haileyok Oct 1, 2024
d0149a9
get scrollview working
haileyok Oct 1, 2024
40030ba
tidy
haileyok Oct 1, 2024
0b55acd
bump
haileyok Oct 1, 2024
368a9df
bump gesture handler
haileyok Oct 1, 2024
a4c7e2f
tweak types
haileyok Oct 1, 2024
e1ccacc
add props back
haileyok Oct 1, 2024
b900ac6
update types
haileyok Oct 2, 2024
baf1923
update other dialog views
haileyok Oct 2, 2024
a3737f0
replace all buttons with `BottomSheetButton`
haileyok Oct 2, 2024
e2f8e7c
fix type
haileyok Oct 2, 2024
81906df
wizard remove buttons
haileyok Oct 2, 2024
cdfdf49
fix
haileyok Oct 2, 2024
8bd6b2d
fix embed consent
haileyok Oct 2, 2024
65bfd89
buttons in account switcher
haileyok Oct 2, 2024
87c83dd
custom bottom sheet link
haileyok Oct 2, 2024
5a60190
nesting support
haileyok Oct 2, 2024
f251a43
Add intent/verify-email to go server (#5554)
estrattonbailey Oct 2, 2024
3569873
Tweak verify email dialog (#5555)
estrattonbailey Oct 2, 2024
1a7885b
Add suspense boundary in onboarding (#5556)
estrattonbailey Oct 2, 2024
d4b8401
android support
haileyok Oct 2, 2024
1ca6d36
fix type
haileyok Oct 2, 2024
a444fc5
import order (#5571)
haileyok Oct 2, 2024
3972d3d
Ignore built files (#5572)
estrattonbailey Oct 2, 2024
4059668
Make reply prompt more subtle on desktop (#5569)
mozzius Oct 2, 2024
b5a5113
simplify pressable changes
haileyok Oct 2, 2024
349b8b7
rm
haileyok Oct 2, 2024
1ea82c3
rename for clairity
haileyok Oct 2, 2024
f558eb6
fix other buttons in dialogs
haileyok Oct 2, 2024
f365ae0
tweak
haileyok Oct 2, 2024
ca0888c
more fixes
haileyok Oct 2, 2024
43eb47f
Merge remote-tracking branch 'origin/main' into hailey/dialogs-pt10
haileyok Oct 2, 2024
13c9c79
move files around (#5576)
mozzius Oct 2, 2024
c2dac85
Delete messages NUX (#5574)
mozzius Oct 2, 2024
1357ac3
bump
haileyok Oct 2, 2024
3fabcc2
revert some changes
haileyok Oct 2, 2024
1ad73e1
Merge remote-tracking branch 'origin/hailey/dialogs-pt1' into hailey/…
haileyok Oct 2, 2024
b0c0aee
custom bottom sheet link
haileyok Oct 2, 2024
84d32e3
simplify pressable changes
haileyok Oct 2, 2024
5fe4ee9
rm
haileyok Oct 2, 2024
839d6dc
rename for clairity
haileyok Oct 2, 2024
1d5a3ef
tweak
haileyok Oct 2, 2024
6d7b54c
fix namE
haileyok Oct 2, 2024
10cb87b
use context to pick default pressable component
haileyok Oct 2, 2024
431f1ff
adjust
haileyok Oct 2, 2024
fee2468
Merge branch 'hailey/dialogs-pt7-rework' into hailey/dialogs-pt8
haileyok Oct 2, 2024
bb33aa0
revert all the button import changes
haileyok Oct 3, 2024
67e4d77
revert all the changes that are not needed'
haileyok Oct 3, 2024
7ef51ac
Merge branch 'hailey/dialogs-pt8' into hailey/dialogs-pt9
haileyok Oct 3, 2024
1bda59c
Merge branch 'hailey/dialogs-pt9' into hailey/dialogs-pt10
haileyok Oct 3, 2024
5c36d8c
remove unused type
haileyok Oct 3, 2024
24bebec
Merge remote-tracking branch 'origin/main' into hailey/dialogs-pt10
haileyok Oct 3, 2024
d007151
move into repo
haileyok Oct 3, 2024
2ac8308
lint
haileyok Oct 3, 2024
52532fb
add config
haileyok Oct 3, 2024
2b98055
update type imports
haileyok Oct 3, 2024
7ee865f
fix import
haileyok Oct 3, 2024
7489a70
add event to ios
haileyok Oct 3, 2024
0ce5d44
simplify logic
haileyok Oct 3, 2024
b6adc93
ensure event fires on open
haileyok Oct 3, 2024
086dde7
log
haileyok Oct 3, 2024
83d1c38
Allow default PressableComponent override
estrattonbailey Oct 3, 2024
639a7ea
fix accessibility
haileyok Oct 3, 2024
8295c23
before spread
haileyok Oct 3, 2024
b64a294
clean
haileyok Oct 3, 2024
97c5053
implement keyboard handling
haileyok Oct 3, 2024
1c14991
rm now useless components
haileyok Oct 3, 2024
c6d7a5f
Merge remote-tracking branch 'origin/hailey/dialogs-pt1' into hailey/…
haileyok Oct 3, 2024
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
1 change: 0 additions & 1 deletion modules/bottom-sheet/src/BottomSheet.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ export interface BottomSheetViewProps {
onStateChange?: (
event: NativeSyntheticEvent<{state: BottomSheetState}>,
) => void
onAttemptDismiss?: (event: NativeSyntheticEvent<object>) => void
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
"react-native-get-random-values": "~1.11.0",
"react-native-image-crop-picker": "0.41.2",
"react-native-ios-context-menu": "^1.15.3",
"react-native-keyboard-controller": "^1.12.1",
"react-native-keyboard-controller": "^1.14.0",
"react-native-mmkv": "^2.12.2",
"react-native-pager-view": "6.2.3",
"react-native-picker-select": "^9.1.3",
Expand Down
9 changes: 6 additions & 3 deletions src/components/Dialog/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, {useImperativeHandle} from 'react'
import {StyleProp, TextInput, View, ViewStyle} from 'react-native'
import {GestureHandlerRootView, ScrollView} from 'react-native-gesture-handler'
import {KeyboardAwareScrollView} from 'react-native-keyboard-controller'
import {useSafeAreaInsets} from 'react-native-safe-area-context'

import {logger} from '#/logger'
Expand Down Expand Up @@ -162,13 +163,15 @@ export const ScrollableInner = React.forwardRef<ScrollView, DialogInnerProps>(
const insets = useSafeAreaInsets()
const {nativeSnapPoint} = useDialogContext()
return (
<ScrollView
<KeyboardAwareScrollView
style={[a.px_xl, style]}
ref={ref}
bounces={nativeSnapPoint === BottomSheetSnapPoint.Full}>
bounces={nativeSnapPoint === BottomSheetSnapPoint.Full}
bottomOffset={30}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kind of a vibe based number. Feels good though, nice bit of padding.

ScrollViewComponent={ScrollView}>
{children}
<View style={{height: insets.bottom + a.pt_5xl.paddingTop}} />
</ScrollView>
</KeyboardAwareScrollView>
)
},
)
Expand Down
31 changes: 0 additions & 31 deletions src/components/KeyboardControllerPadding.android.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions src/components/KeyboardControllerPadding.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions src/components/ReportDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {AppBskyLabelerDefs} from '@atproto/api'
import {atoms as a} from '#/alf'
import * as Dialog from '#/components/Dialog'
import {useDelayedLoading} from '#/components/hooks/useDelayedLoading'
import {useOnKeyboardDidShow} from '#/components/hooks/useOnKeyboard'
import {Loader} from '#/components/Loader'
import {Text} from '#/components/Typography'
import {SelectLabelerView} from './SelectLabelerView'
Expand All @@ -39,9 +38,6 @@ function ReportDialogInner(props: ReportDialogProps) {
const isLoading = useDelayedLoading(500, isLabelerLoading)

const ref = React.useRef<ScrollView>(null)
useOnKeyboardDidShow(() => {
ref.current?.scrollToEnd({animated: true})
})
Comment on lines -42 to -44
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No longer needed 🥹


return (
<Dialog.ScrollableInner label={_(msg`Report dialog`)} ref={ref}>
Expand Down
2 changes: 0 additions & 2 deletions src/components/dms/ReportDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {CharProgress} from '#/view/com/composer/char-progress/CharProgress'
import * as Toast from '#/view/com/util/Toast'
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
import * as Dialog from '#/components/Dialog'
import {KeyboardControllerPadding} from '#/components/KeyboardControllerPadding'
import {Button, ButtonIcon, ButtonText} from '../Button'
import {Divider} from '../Divider'
import {ChevronLeft_Stroke2_Corner0_Rounded as Chevron} from '../icons/Chevron'
Expand Down Expand Up @@ -44,7 +43,6 @@ let ReportDialog = ({
<Dialog.ScrollableInner label={_(msg`Report this message`)}>
<DialogInner params={params} />
<Dialog.Close />
<KeyboardControllerPadding />
</Dialog.ScrollableInner>
</Dialog.Outer>
)
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18099,10 +18099,10 @@ react-native-ios-context-menu@^1.15.3:
dependencies:
"@dominicstop/ts-event-emitter" "^1.1.0"

react-native-keyboard-controller@^1.12.1:
version "1.12.1"
resolved "https://registry.yarnpkg.com/react-native-keyboard-controller/-/react-native-keyboard-controller-1.12.1.tgz#6de22ed4d060528a0dd25621eeaa7f71772ce35f"
integrity sha512-2OpQcesiYsMilrTzgcTafSGexd9UryRQRuHudIcOn0YaqvvzNpnhVZMVuJMH93fJv/iaZYp3138rgUKOdHhtSw==
react-native-keyboard-controller@^1.14.0:
version "1.14.0"
resolved "https://registry.yarnpkg.com/react-native-keyboard-controller/-/react-native-keyboard-controller-1.14.0.tgz#f6faaa12b3736a10f4eec4236ed5b0343508b9a1"
integrity sha512-JW9k2fehFXOpvLWh1YcgyubLodg/HPi6bR11sCZB/BOawf1tnbGnqk967B8XkxDOKHH6mg+z82quCvv8ALh1rg==

react-native-mmkv@^2.12.2:
version "2.12.2"
Expand Down
Loading