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 f109e10a491a96afc62248e840a0b22ef5ecd3bd..32d8b10ca1bb76f9036c8ec0beeb0a6e594a8087 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 ");