Skip to content

Commit

Permalink
Fix issue with the window becoming unresponsive in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 9, 2023
1 parent 189b45f commit 164470c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Color Picker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@
repositoryURL = "https://github.com/getsentry/sentry-cocoa";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 8.3.3;
minimumVersion = 8.4.0;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
3 changes: 1 addition & 2 deletions Color Picker/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ struct NativeTextField: NSViewRepresentable {
// Cannot be `.leftMouseUp` as the color wheel swallows it.
localEventMonitor = LocalEventMonitor(events: [.leftMouseDown, .rightMouseDown, .keyDown]) { [weak self] event in
guard let self else {
return nil
return event
}

if event.type == .keyDown {
Expand All @@ -1080,7 +1080,6 @@ struct NativeTextField: NSViewRepresentable {

if !frame.insetBy(dx: -clickMargin, dy: -clickMargin).contains(clickPoint) {
unfocus()
return nil
} else {
parent.isFocused = true
}
Expand Down

0 comments on commit 164470c

Please sign in to comment.