Skip to content

Commit

Permalink
Fix Default Selection in Settings (#1547)
Browse files Browse the repository at this point in the history
* fix(#1540): fix default selection in settings

* fix(#1546): cancel capitalized for settings search results
  • Loading branch information
RayZhao1998 authored Jan 9, 2024
1 parent 9db0309 commit 683942e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions CodeEdit/Features/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct SettingsView: View {
private var colorScheme

/// Variables for the selected Page, the current search text and software updater
@State private var selectedPage: SettingsPage = SettingsPage(.general)
@State private var selectedPage: SettingsPage = Self.pages[0].page
@State private var searchText: String = ""

@Environment(\.presentationMode)
Expand Down Expand Up @@ -112,7 +112,7 @@ struct SettingsView: View {

ForEach(results.pages, id: \.settingName) { setting in
NavigationLink(value: setting) {
setting.settingName.capitalized.highlightOccurrences(searchText)
setting.settingName.highlightOccurrences(searchText)
.padding(.leading, 22)
}
}
Expand All @@ -136,13 +136,8 @@ struct SettingsView: View {
}
}
}
.searchable(text: $searchText, placement: .sidebar, prompt: "Search")
.navigationSplitViewColumnWidth(215)
.safeAreaInset(edge: .top, spacing: 0) {
List {}
.frame(height: 35)
.searchable(text: $searchText, placement: .sidebar, prompt: "Search")
.scrollDisabled(true)
}
} detail: {
Group {
switch selectedPage.name {
Expand Down

0 comments on commit 683942e

Please sign in to comment.