Skip to content

Commit fe8e82a

Browse files
committed
Fix that suggestion panel buttons can't be clicked when completion panel is displayed
1 parent 420191e commit fe8e82a

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Core/Sources/SuggestionWidget/SuggestionWidgetController.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,14 @@ public final class SuggestionWidgetController: NSObject {
289289
systemColorSchemeChangeObserver.onChange = {
290290
updateColorScheme()
291291
}
292-
}
293292

294-
Task { @MainActor in
295-
XcodeInspector.shared.$completionPanel.sink { [weak self] _ in
293+
XcodeInspector.shared.$completionPanel.sink { [weak self] newValue in
296294
Task { @MainActor in
295+
if newValue == nil {
296+
// so that the buttons on the suggestion panel could be clicked
297+
// before the completion panel updates the location of the suggestion panel
298+
try await Task.sleep(nanoseconds: 200_000_000)
299+
}
297300
self?.updateWindowLocation()
298301
}
299302
}.store(in: &cancellable)

0 commit comments

Comments
 (0)