Skip to content

Commit c48e7a4

Browse files
Fix WebView support (#49958)
1 parent 498cd15 commit c48e7a4

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Components/Web.JS/dist/Release/blazor.webview.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/Web.JS/src/Platform/WebView/WebViewIpcReceiver.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
import { DotNet } from '@microsoft/dotnet-js-interop';
54
import { showErrorNotification } from '../../BootErrors';
65
import { OutOfProcessRenderBatch } from '../../Rendering/RenderBatch/OutOfProcessRenderBatch';
76
import { attachRootComponentToElement, renderBatch } from '../../Rendering/Renderer';
87
import { setApplicationIsTerminated, tryDeserializeMessage } from './WebViewIpcCommon';
98
import { sendRenderCompleted } from './WebViewIpcSender';
109
import { internalFunctions as navigationManagerFunctions } from '../../Services/NavigationManager';
1110
import { dispatcher } from '../../Boot.WebView';
11+
import { WebRendererId } from '../../Rendering/WebRendererId';
1212

1313
export function startIpcReceiver(): void {
1414
const messageHandlers = {
1515

1616
'AttachToDocument': (componentId: number, elementSelector: string) => {
17-
attachRootComponentToElement(elementSelector, componentId);
17+
attachRootComponentToElement(elementSelector, componentId, WebRendererId.WebView);
1818
},
1919

2020
'RenderBatch': (batchId: number, batchDataBase64: string) => {
2121
try {
2222
const batchData = base64ToArrayBuffer(batchDataBase64);
23-
renderBatch(0, new OutOfProcessRenderBatch(batchData));
23+
renderBatch(WebRendererId.WebView, new OutOfProcessRenderBatch(batchData));
2424
sendRenderCompleted(batchId, null);
2525
} catch (ex) {
2626
sendRenderCompleted(batchId, (ex as Error).toString());

src/Components/Web.JS/src/Rendering/Renderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function attachRootComponentToLogicalElement(browserRendererId: number, l
2424
browserRenderer.attachRootComponentToLogicalElement(componentId, logicalElement, appendContent);
2525
}
2626

27-
export function attachRootComponentToElement(elementSelector: string, componentId: number, browserRendererId?: number): void {
27+
export function attachRootComponentToElement(elementSelector: string, componentId: number, browserRendererId: number): void {
2828
const afterElementSelector = '::after';
2929
const beforeElementSelector = '::before';
3030
let appendContent = false;

0 commit comments

Comments
 (0)