Skip to content

Commit

Permalink
fix(wkwebview): make webview first responder (#740)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd authored Oct 28, 2022
1 parent fea0638 commit e64ad21
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/wkwebview-make-first-responder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": patch
---

On macOS, make the webview first responder.
3 changes: 3 additions & 0 deletions src/webview/wkwebview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,9 @@ r#"Object.defineProperty(window, 'ipc', {
// expect tao::Window to hold a handle to it and release it for us
// eventually.
let _: () = msg_send![ns_window, setContentView: parent_view];
// Tell the webview receive keyboard events in the window.
// See https://github.com/tauri-apps/wry/issues/739
let _: () = msg_send![ns_window, makeFirstResponder: webview];

// make sure the window is always on top when we create a new webview
let app_class = class!(NSApplication);
Expand Down

0 comments on commit e64ad21

Please sign in to comment.