1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Mobile: Plugins: Fix plugin panel buttons are offscreen on recent versions of Android (#13080)

This commit is contained in:
Henry Heino
2025-08-29 14:28:22 -07:00
committed by GitHub
parent 3e9bb914e5
commit 859bc8d88e

View File

@@ -27,11 +27,23 @@ export interface ModalElementProps extends ModalProps {
const useStyles = (hasScrollView: boolean, backgroundColor: string|undefined) => {
const safeAreaPadding = useSafeAreaPadding();
return useMemo(() => {
// On Android, the top-level container seems to need to be absolutely positioned
// to prevent it from being larger than the screen size:
const absoluteFill = {
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
} satisfies ViewStyle;
return StyleSheet.create({
modalBackground: {
...safeAreaPadding,
...(hasScrollView ? {
flexGrow: 1,
flexShrink: 1,
} : absoluteFill),
// When hasScrollView, the modal background is wrapped in a ScrollView. In this case, it's
// possible to scroll content outside the background into view. To prevent the edge of the
@@ -40,6 +52,7 @@ const useStyles = (hasScrollView: boolean, backgroundColor: string|undefined) =>
backgroundColor: hasScrollView ? null : backgroundColor,
},
keyboardAvoidingView: {
...absoluteFill,
flex: 1,
},
modalScrollView: {