Browse Source
Merge branch 'master' into feature/onplatform-xaml-compiler-support
release/11.0.0-preview3
Dan Walmsley
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
10 additions and
3 deletions
-
src/Web/Avalonia.Web/AvaloniaView.cs
-
src/Web/Avalonia.Web/webapp/modules/avalonia/dom.ts
|
|
|
@ -254,7 +254,14 @@ namespace Avalonia.Web |
|
|
|
|
|
|
|
private bool OnKeyDown (string code, string key, int modifier) |
|
|
|
{ |
|
|
|
return _topLevelImpl.RawKeyboardEvent(RawKeyEventType.KeyDown, code, key, (RawInputModifiers)modifier); |
|
|
|
var handled = _topLevelImpl.RawKeyboardEvent(RawKeyEventType.KeyDown, code, key, (RawInputModifiers)modifier); |
|
|
|
|
|
|
|
if (!handled && key.Length == 1) |
|
|
|
{ |
|
|
|
handled = _topLevelImpl.RawTextEvent(key); |
|
|
|
} |
|
|
|
|
|
|
|
return handled; |
|
|
|
} |
|
|
|
|
|
|
|
private bool OnKeyUp(string code, string key, int modifier) |
|
|
|
|
|
|
|
@ -24,7 +24,7 @@ export class AvaloniaDOM { |
|
|
|
|
|
|
|
// Native controls host
|
|
|
|
const nativeHost = document.createElement("div"); |
|
|
|
canvas.id = `nativeHost${randomIdPart}`; |
|
|
|
nativeHost.id = `nativeHost${randomIdPart}`; |
|
|
|
nativeHost.classList.add("avalonia-native-host"); |
|
|
|
nativeHost.style.left = "0px"; |
|
|
|
nativeHost.style.top = "0px"; |
|
|
|
@ -34,7 +34,7 @@ export class AvaloniaDOM { |
|
|
|
|
|
|
|
// IME
|
|
|
|
const inputElement = document.createElement("input"); |
|
|
|
canvas.id = `input${randomIdPart}`; |
|
|
|
inputElement.id = `inputElement${randomIdPart}`; |
|
|
|
inputElement.classList.add("avalonia-input-element"); |
|
|
|
inputElement.autocapitalize = "none"; |
|
|
|
inputElement.type = "text"; |
|
|
|
|