Skip to content

Commit d04eb93

Browse files
authored
Merge pull request #273 from react-native-oh-library/llh_sig_without_codegen
fix: 同步sig分支代码
2 parents a5adb6f + 2191f29 commit d04eb93

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

harmony/rn_webview/src/main/ets/RNCWebView.ets

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import {
4646
MINHEIGHT,
4747
} from './Magic';
4848
import { bundleManager } from '@kit.AbilityKit';
49-
5049
export const TAG = "WebView"
5150

5251
export const WEB_VIEW = "RNCWebView"
@@ -366,7 +365,7 @@ export struct RNCWebView {
366365
Web({ src: "", controller: this.controller, renderMode: this.renderMode })
367366
.mixedMode(this.mode)
368367
.onPermissionRequest((event: OnPermissionRequestEvent) => {
369-
if (event) {
368+
if (event && (this.getPermissionDialogMessage(event) != "TYPE_SENSOR")) {
370369
AlertDialog.show({
371370
title: this.resourceToString($r('app.string.on_confirm')) + event.request.getOrigin(),
372371
message: this.getPermissionDialogMessage(event),
@@ -401,6 +400,7 @@ export struct RNCWebView {
401400
.verticalScrollBarAccess(this.descriptorWrapper.rawProps.showsVerticalScrollIndicator)
402401
.overviewModeAccess(this.descriptorWrapper.rawProps.scalesPageToFit)
403402
.textZoomRatio(this.descriptorWrapper.rawProps.textZoom)
403+
.backgroundColor(BaseOperate.getColorMode(this.ctx.uiAbilityContext, this.descriptorWrapper.rawProps.forceDarkOn) === WebDarkMode.On ? Color.White : Color.Transparent)
404404
.darkMode(BaseOperate.getColorMode(this.ctx.uiAbilityContext, this.descriptorWrapper.rawProps.forceDarkOn))
405405
.forceDarkAccess(this.forceDark)
406406
.cacheMode(this.cacheMode)
@@ -492,8 +492,8 @@ export struct RNCWebView {
492492
})
493493
}
494494
this.html = this.source.html
495-
this.webviewWidth = this.descriptorWrapper.rawProps.width
496-
this.webviewHeight = this.descriptorWrapper.rawProps.height
495+
this.webviewWidth = this.descriptorWrapper.layoutMetrics.frame.size.width
496+
this.webviewHeight = this.descriptorWrapper.layoutMetrics.frame.size.height
497497
this.scrollEnabled = this.descriptorWrapper.rawProps.scrollEnabled;
498498
// 当禁止滚动时,使用父组件滚动
499499
this.nestedScroll = this.scrollEnabled ? NestedScrollMode.SELF_FIRST : NestedScrollMode.PARENT_FIRST;

0 commit comments

Comments
 (0)