mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-21 22:19:41 +01:00
scroll fix
This commit is contained in:
@@ -17,12 +17,12 @@ const ActionSheetWrapper = ({
|
||||
const [state] = useTracked();
|
||||
const {colors} = state;
|
||||
const largeTablet = DDS.isLargeTablet();
|
||||
const smallTablet = DDS.isTab;
|
||||
|
||||
const style = React.useMemo(() => {
|
||||
return {
|
||||
width: largeTablet ? 500 : '100%',
|
||||
minHeight: largeTablet ? 100 : null,
|
||||
maxHeight: largeTablet ? 500 : '90%',
|
||||
width: largeTablet || smallTablet ? 500 : '100%',
|
||||
maxHeight: largeTablet ? 500 : '100%',
|
||||
borderTopRightRadius: 10,
|
||||
borderTopLeftRadius: 10,
|
||||
backgroundColor: colors.bg,
|
||||
|
||||
@@ -57,6 +57,7 @@ export const ActionSheetComponent = ({
|
||||
hasTags = false,
|
||||
rowItems = [],
|
||||
columnItems = [],
|
||||
getRef,
|
||||
}) => {
|
||||
const [state, dispatch] = useTracked();
|
||||
const {colors, premiumUser, user} = state;
|
||||
@@ -511,8 +512,16 @@ export const ActionSheetComponent = ({
|
||||
}
|
||||
};
|
||||
|
||||
const onScrollEnd = () => {
|
||||
getRef().current?.childScrollHandler();
|
||||
};
|
||||
|
||||
return (
|
||||
<ScrollView
|
||||
nestedScrollEnabled
|
||||
onScrollEndDrag={onScrollEnd}
|
||||
onScrollAnimationEnd={onScrollEnd}
|
||||
onMomentumScrollEnd={onScrollEnd}
|
||||
onLayout={() => {
|
||||
if (!item.dateDeleted) {
|
||||
localRefresh(item.type, true);
|
||||
@@ -523,7 +532,7 @@ export const ActionSheetComponent = ({
|
||||
backgroundColor: colors.bg,
|
||||
paddingHorizontal: 0,
|
||||
borderBottomRightRadius: DDS.isLargeTablet() ? 10 : 1,
|
||||
borderBottomLeftRadius:DDS.isLargeTablet()? 10 : 1
|
||||
borderBottomLeftRadius: DDS.isLargeTablet() ? 10 : 1,
|
||||
}}>
|
||||
<TouchableOpacity
|
||||
style={{
|
||||
|
||||
@@ -301,7 +301,6 @@ export class DialogManager extends Component {
|
||||
render() {
|
||||
let {colors} = this.props;
|
||||
let {actionSheetData, item, simpleDialog} = this.state;
|
||||
console.log(DDS.isLargeTablet())
|
||||
return (
|
||||
<>
|
||||
{!this.state.actionSheetVisible ? null : (
|
||||
@@ -319,6 +318,7 @@ export class DialogManager extends Component {
|
||||
setWillRefresh={(value) => {
|
||||
this.willRefresh = true;
|
||||
}}
|
||||
getRef={() => this.actionSheet}
|
||||
hasColors={actionSheetData.colors}
|
||||
hasTags={actionSheetData.colors}
|
||||
overlayColor={
|
||||
|
||||
@@ -5,27 +5,25 @@ import {
|
||||
ScrollView,
|
||||
TextInput,
|
||||
TouchableOpacity,
|
||||
View,
|
||||
View
|
||||
} from 'react-native';
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
import { notesnook } from '../../../e2e/test.ids';
|
||||
import { useTracked } from '../../provider';
|
||||
import { Actions } from '../../provider/Actions';
|
||||
import {DDS} from '../../services/DeviceDetection';
|
||||
import {
|
||||
eSendEvent,
|
||||
eSubscribeEvent,
|
||||
eUnSubscribeEvent,
|
||||
ToastEvent,
|
||||
ToastEvent
|
||||
} from '../../services/EventManager';
|
||||
import { db } from '../../utils/DB';
|
||||
import {
|
||||
eOnNewTopicAdded,
|
||||
eOpenMoveNoteDialog,
|
||||
refreshNotesPage,
|
||||
refreshNotesPage
|
||||
} from '../../utils/Events';
|
||||
import { pv, SIZE, WEIGHT } from '../../utils/SizeUtils';
|
||||
import ActionSheet from '../ActionSheet';
|
||||
import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';
|
||||
import DialogHeader from '../Dialog/dialog-header';
|
||||
import { PressableButton } from '../PressableButton';
|
||||
|
||||
@@ -206,6 +206,15 @@ const RestoreDataComponent = ({close, setRestoring, restoring}) => {
|
||||
|
||||
<ScrollView
|
||||
nestedScrollEnabled
|
||||
onScrollEndDrag={() => {
|
||||
actionSheetRef.current?.childScrollHandler();
|
||||
}}
|
||||
onMomentumScrollEnd={() => {
|
||||
actionSheetRef.current?.childScrollHandler();
|
||||
}}
|
||||
onScrollAnimationEnd={() => {
|
||||
actionSheetRef.current?.childScrollHandler();
|
||||
}}
|
||||
style={{
|
||||
paddingHorizontal: 12,
|
||||
}}>
|
||||
|
||||
Reference in New Issue
Block a user