You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
Mobile: Plugins: Fix plugin panel buttons are offscreen on recent versions of Android (#13080)
This commit is contained in:
@@ -27,11 +27,23 @@ export interface ModalElementProps extends ModalProps {
|
|||||||
const useStyles = (hasScrollView: boolean, backgroundColor: string|undefined) => {
|
const useStyles = (hasScrollView: boolean, backgroundColor: string|undefined) => {
|
||||||
const safeAreaPadding = useSafeAreaPadding();
|
const safeAreaPadding = useSafeAreaPadding();
|
||||||
return useMemo(() => {
|
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({
|
return StyleSheet.create({
|
||||||
modalBackground: {
|
modalBackground: {
|
||||||
...safeAreaPadding,
|
...safeAreaPadding,
|
||||||
flexGrow: 1,
|
...(hasScrollView ? {
|
||||||
flexShrink: 1,
|
flexGrow: 1,
|
||||||
|
flexShrink: 1,
|
||||||
|
} : absoluteFill),
|
||||||
|
|
||||||
// When hasScrollView, the modal background is wrapped in a ScrollView. In this case, it's
|
// 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
|
// 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,
|
backgroundColor: hasScrollView ? null : backgroundColor,
|
||||||
},
|
},
|
||||||
keyboardAvoidingView: {
|
keyboardAvoidingView: {
|
||||||
|
...absoluteFill,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
},
|
},
|
||||||
modalScrollView: {
|
modalScrollView: {
|
||||||
|
|||||||
Reference in New Issue
Block a user