Skip to content
This repository was archived by the owner on Nov 27, 2025. It is now read-only.

Commit 0103bf0

Browse files
适配OS删除自适应和嵌套滚动属性,删除2Dsdk不存在的onsizechange属性
Signed-off-by: leehom <[email protected]>
1 parent fda3bcb commit 0103bf0

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

harmony/rn_webview.har

27 Bytes
Binary file not shown.

harmony/rn_webview/oh-package.json5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"name": "@react-native-oh-tpl/react-native-webview",
77
"description": "main cpai architecture",
88
"main": "index.ets",
9-
"version": "13.6.3-0.1.1",
9+
"version": "13.6.3-0.1.2",
1010
"dependencies": {
11-
"@rnoh/react-native-openharmony": "file:../rnoh"
11+
"@rnoh/react-native-openharmony": "file:../react_native_openharmony"
1212
}
1313
}

harmony/rn_webview/src/main/ets/WebView.ets

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export interface WebViewProps extends ViewBaseProps {
5858
messagingModuleName: string
5959
shouldStartLoadWithRequestEnabled: boolean
6060
webviewDebuggingEnabled: boolean
61-
nestedScrollEnabled: boolean
61+
// nestedScrollEnabled: boolean
6262
}
6363

6464
export class RNCWebViewBridge {
@@ -108,7 +108,7 @@ export struct WebView {
108108
messagingEnabled: boolean = false;
109109
hasRegisterJavaScriptProxy: boolean = false;
110110
controllerAttached: boolean = false;
111-
nestedScrollFlag: boolean = false;
111+
// nestedScrollFlag: boolean = false;
112112
renderMode: RenderMode = RenderMode.SYNC_RENDER;
113113

114114
aboutToAppear() {
@@ -151,9 +151,9 @@ export struct WebView {
151151
this.source = this.descriptor.props.newSource
152152
this.html = this.source.html
153153
this.url = this.source.uri;
154-
this.nestedScrollFlag = this.descriptor.props.nestedScrollEnabled;
154+
// this.nestedScrollFlag = this.descriptor.props.nestedScrollEnabled;
155155
// nestedScrollEnabled true表示可嵌套滚动,不需要自适应和web统一渲染,默认是false
156-
this.renderMode = this.nestedScrollFlag?RenderMode.ASYNC_RENDER:RenderMode.SYNC_RENDER
156+
// this.renderMode = this.nestedScrollFlag?RenderMode.ASYNC_RENDER:RenderMode.SYNC_RENDER
157157
this.registerCommandCallback()
158158
}
159159

@@ -378,16 +378,16 @@ export struct WebView {
378378
.domStorageAccess(this.descriptor.props.domStorageEnabled)
379379
.zoomAccess(this.descriptor.props.scalesPageToFit)
380380
// nestedScrollFlag 为true 表示可以在嵌套滚动中,web自己能滚动
381-
.layoutMode(this.nestedScrollFlag ? WebLayoutMode.NONE : WebLayoutMode.FIT_CONTENT)
381+
// .layoutMode(this.nestedScrollFlag ? WebLayoutMode.NONE : WebLayoutMode.FIT_CONTENT)
382382

383-
.nestedScroll(this.nestedScrollFlag ? {
384-
scrollForward: NestedScrollMode.SELF_ONLY,
385-
scrollBackward: NestedScrollMode.SELF_ONLY
386-
} : { scrollForward: NestedScrollMode.PARENT_FIRST, scrollBackward: NestedScrollMode.PARENT_FIRST })
387-
.overScrollMode(OverScrollMode.NEVER)
388-
.onSizeChange((event)=>{
389-
Logger.debug(TAG, "[RNOH] event width: " + event.width + "[RNOH] event height: " + event.height)
390-
})
383+
// .nestedScroll(this.nestedScrollFlag ? {
384+
// scrollForward: NestedScrollMode.SELF_ONLY,
385+
// scrollBackward: NestedScrollMode.SELF_ONLY
386+
// } : { scrollForward: NestedScrollMode.PARENT_FIRST, scrollBackward: NestedScrollMode.PARENT_FIRST })
387+
// .overScrollMode(OverScrollMode.NEVER)
388+
// .onSizeChange((event)=>{
389+
// Logger.debug(TAG, "[RNOH] event width: " + event.width + "[RNOH] event height: " + event.height)
390+
// })
391391
.onProgressChange((event) => {
392392
if (event) {
393393
this.progress = event.newProgress

0 commit comments

Comments
 (0)