diff --git a/packages/api-proxy/src/platform/api/create-intersection-observer/rnIntersectionObserver.js b/packages/api-proxy/src/platform/api/create-intersection-observer/rnIntersectionObserver.js index 059ae453b..038b67099 100644 --- a/packages/api-proxy/src/platform/api/create-intersection-observer/rnIntersectionObserver.js +++ b/packages/api-proxy/src/platform/api/create-intersection-observer/rnIntersectionObserver.js @@ -96,7 +96,7 @@ class RNIntersectionObserver { const windowRect = { top: navigationLayout.y + this.margins.top, - left: navigationLayout.x + this.margins.left, + left: this.margins.left, right: navigationLayout.width - this.margins.right, bottom: navigationLayout.y + navigationLayout.height - this.margins.bottom } diff --git a/packages/core/src/platform/createApp.ios.js b/packages/core/src/platform/createApp.ios.js index 5fae55fa0..226894d9f 100644 --- a/packages/core/src/platform/createApp.ios.js +++ b/packages/core/src/platform/createApp.ios.js @@ -1,6 +1,6 @@ import transferOptions from '../core/transferOptions' import builtInKeysMap from './patch/builtInKeysMap' -import { makeMap, spreadProp, parseUrlQuery, getFocusedNavigation, hasOwn, extend } from '@mpxjs/utils' +import { makeMap, spreadProp, getFocusedNavigation, hasOwn, extend } from '@mpxjs/utils' import { mergeLifecycle } from '../convertor/mergeLifecycle' import { LIFECYCLE } from '../platform/patch/lifecycle/index' import Mpx from '../index' @@ -96,14 +96,10 @@ export default function createApp (option, config = {}) { }) if (!global.__mpxAppLaunched) { - const parsed = Mpx.config.rnConfig.parseAppProps?.(props) || {} - if (parsed.url) { - const { path, queryObj } = parseUrlQuery(parsed.url) - Object.assign(initialRouteRef.current, { - initialRouteName: path.startsWith('/') ? path.slice(1) : path, - initialParams: queryObj - }) - } + const { initialRouteName, initialParams } = Mpx.config.rnConfig.parseAppProps?.(props) || {} + initialRouteRef.current.initialRouteName = initialRouteName || initialRouteRef.current.initialRouteName + initialRouteRef.current.initialParams = initialParams || initialRouteRef.current.initialParams + global.__mpxAppOnLaunch = (navigation) => { global.__mpxAppLaunched = true const state = navigation.getState() @@ -156,7 +152,7 @@ export default function createApp (option, config = {}) { if (navigation && hasOwn(global.__mpxPageStatusMap, navigation.pageId)) { global.__mpxPageStatusMap[navigation.pageId] = 'show' } - } else if (currentState === 'inactive') { + } else if (currentState === 'inactive' || currentState === 'background') { global.__mpxAppCbs.hide.forEach((cb) => { cb() }) @@ -191,7 +187,8 @@ export default function createApp (option, config = {}) { // 7.x替换headerBackTitleVisible // headerBackButtonDisplayMode: 'minimal', headerBackTitleVisible: false, - headerMode: 'float' + // 安卓上会出现初始化时闪现导航条的问题 + headerShown: false } if (headerBackImageProps) { navScreenOpts.headerBackImage = () => { diff --git a/packages/webpack-plugin/lib/runtime/components/react/getInnerListeners.ts b/packages/webpack-plugin/lib/runtime/components/react/getInnerListeners.ts index 4a8b5c067..10f0ae130 100644 --- a/packages/webpack-plugin/lib/runtime/components/react/getInnerListeners.ts +++ b/packages/webpack-plugin/lib/runtime/components/react/getInnerListeners.ts @@ -289,7 +289,6 @@ const useInnerProps = ( const eventConfig: { [key: string]: string[] } = {} const config = rawConfig || { layoutRef: { current: {} }, - disableTouch: false, disableTap: false } const removeProps = [ @@ -317,11 +316,10 @@ const useInnerProps = ( } } - if (!rawEventKeys.length || config.disableTouch) { - return omit(propsRef.current, removeProps) - } - const events = useMemo(() => { + if (!rawEventKeys.length) { + return {} + } const transformedEventKeys = rawEventKeys.reduce((acc: string[], key) => { if (propsRef.current[key]) { return acc.concat(eventConfig[key])