Skip to content

Commit 3a02265

Browse files
committed
disable keyboard auto-focus on iOS add sheets (closes 0xCUB3#249)
1 parent bd92278 commit 3a02265

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

wBlock/ContentView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,12 +803,14 @@ struct AddFilterListView: View {
803803
macosBody
804804
#endif
805805
}
806+
#if os(macOS)
806807
.onAppear {
807808
urlFieldIsFocused = addMode == .url
808809
}
809810
.onChange(of: addMode) { _, newValue in
810811
urlFieldIsFocused = newValue == .url
811812
}
813+
#endif
812814
.fileImporter(
813815
isPresented: $showingFileImporter,
814816
allowedContentTypes: [UTType.plainText, UTType.text],

wBlock/UserScriptManagerView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,12 +958,14 @@ struct AddUserScriptView: View {
958958
#endif
959959
}
960960
.interactiveDismissDisabled(isAdding)
961+
#if os(macOS)
961962
.onAppear {
962963
urlFieldFocused = addMode == .url
963964
}
964965
.onChange(of: addMode) { _, newValue in
965966
urlFieldFocused = newValue == .url
966967
}
968+
#endif
967969
.onChange(of: urlInput) { _, newValue in
968970
validateInput(newValue)
969971
}

0 commit comments

Comments
 (0)