From b121156cd2b6f32ed6b1ca508a24aa66606be6e7 Mon Sep 17 00:00:00 2001 From: xuchang Date: Fri, 17 Jan 2025 17:07:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9FLutterPage=20focusOnT?= =?UTF-8?q?ouch=E9=BB=98=E8=AE=A4=E4=B8=BAfalse=EF=BC=9B=E8=A7=A3=E5=86=B3?= =?UTF-8?q?webview=E9=95=BF=E6=8C=89=E5=A4=8D=E5=88=B6=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E6=B0=94=E6=B3=A1=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuchang --- .../flutter/src/main/ets/embedding/ohos/FlutterPage.ets | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/ohos/FlutterPage.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/ohos/FlutterPage.ets index f109e10a49..32d8b10ca1 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/ohos/FlutterPage.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/ohos/FlutterPage.ets @@ -29,6 +29,7 @@ export struct FlutterPage { @Prop viewId: string = "" @Prop xComponentType: XComponentType = XComponentType.SURFACE + defaultFocusOnTouch = false; @Builder doNothingBuilder() {} @BuilderParam splashScreenView: () => void = this.doNothingBuilder; @Builder defaultPage() { @@ -53,7 +54,7 @@ export struct FlutterPage { XComponent({ id: this.viewId, type: this.xComponentType, libraryname: 'flutter' }) .id(this.viewId) .focusable(true) - .focusOnTouch(true) + .focusOnTouch(this.defaultFocusOnTouch) .onLoad((context) => { this.flutterView?.onSurfaceCreated() Log.d(TAG, "XComponent onLoad "); @@ -134,7 +135,7 @@ export struct FlutterPage { XComponent({ id: this.viewId, type: this.xComponentType, libraryname: 'flutter' }) .id(this.viewId) .focusable(true) - .focusOnTouch(true) + .focusOnTouch(this.defaultFocusOnTouch) .onLoad((context) => { this.flutterView?.onSurfaceCreated() Log.d(TAG, "XComponent onLoad "); -- Gitee