From 270474f541620ea7cea810e36d544939faeb29c1 Mon Sep 17 00:00:00 2001 From: landluck Date: Tue, 6 Dec 2022 10:46:19 +0800 Subject: [PATCH] fix(transition): fix requestAnimationFrame is not executed in the background (#5131) --- packages/common/utils.ts | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/packages/common/utils.ts b/packages/common/utils.ts index fe3f44e6..44930791 100644 --- a/packages/common/utils.ts +++ b/packages/common/utils.ts @@ -1,5 +1,5 @@ import { isDef, isNumber, isPlainObject, isPromise } from './validator'; -import { canIUseGroupSetData, canIUseNextTick, getSystemInfoSync } from './version'; +import { canIUseGroupSetData, canIUseNextTick } from './version'; export { isDef } from './validator'; export { getSystemInfoSync } from './version'; @@ -28,21 +28,9 @@ export function addUnit(value?: string | number): string | undefined { } export function requestAnimationFrame(cb: () => void) { - const systemInfo = getSystemInfoSync(); - - if (systemInfo.platform === 'devtools') { - return setTimeout(() => { - cb(); - }, 1000 / 30); - } - - return wx - .createSelectorQuery() - .selectViewport() - .boundingClientRect() - .exec(() => { - cb(); - }); + return setTimeout(() => { + cb(); + }, 1000 / 30); } export function pickExclude(obj: unknown, keys: string[]) {