From 28e05c407e5d406dd9b7cfa796330d22ad35d747 Mon Sep 17 00:00:00 2001 From: Anthony Fernandez Date: Mon, 22 Mar 2021 12:25:10 +0100 Subject: [PATCH] Remove autofocus (not stable) --- Snip/Components/Sidebar/SnipItemView.swift | 10 +++++----- Snip/Components/Welcome/WelcomeView.swift | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Snip/Components/Sidebar/SnipItemView.swift b/Snip/Components/Sidebar/SnipItemView.swift index 27f14c7..c1ccb5f 100644 --- a/Snip/Components/Sidebar/SnipItemView.swift +++ b/Snip/Components/Sidebar/SnipItemView.swift @@ -21,7 +21,7 @@ struct SnipItemView: View { @State private var isExpanded: Bool = false @State private var isEditingName = false - @State var hasTriggered: Bool = false + //@State var hasTriggered: Bool = false let content: () -> Content? @@ -73,13 +73,13 @@ struct SnipItemView: View { .frame(maxWidth: .infinity, alignment: .leading) .padding(EdgeInsets(top: 4, leading: 0, bottom: 4, trailing: 0)) .background(themePrimaryColor) - .introspectTextField { textField in + /*.introspectTextField { textField in if self.hasTriggered == false { textField.becomeFirstResponder() self.hasTriggered = true } } - .onAppear(perform: {self.hasTriggered = false}) + .onAppear(perform: {self.hasTriggered = false})*/ .onHover { inside in if inside { NSCursor.iBeam.push() @@ -180,13 +180,13 @@ struct SnipItemView: View { .frame(maxWidth: .infinity, alignment: .leading) .padding(.leading, 4) .background(themePrimaryColor) - .introspectTextField { textField in + /*.introspectTextField { textField in if self.hasTriggered == false { textField.becomeFirstResponder() self.hasTriggered = true } } - .onAppear(perform: {self.hasTriggered = false}) + .onAppear(perform: {self.hasTriggered = false})*/ .onHover { inside in if inside { NSCursor.iBeam.push() diff --git a/Snip/Components/Welcome/WelcomeView.swift b/Snip/Components/Welcome/WelcomeView.swift index c2481db..1b6b696 100644 --- a/Snip/Components/Welcome/WelcomeView.swift +++ b/Snip/Components/Welcome/WelcomeView.swift @@ -38,7 +38,7 @@ struct WelcomeView: View { .foregroundColor(themeTextColor) .padding(EdgeInsets(top: 16, leading: 0, bottom: 16, trailing: 0)) HStack { - Text("- Fix sidebar icon not visible\n- Auto close tags and brackets\n- better search and replace dialog\n- Added indent size setting\n- Added default mode setting\n- New icon\n- Added autofocus when renaming a snippet\n- Disabled window tabbing") + Text("- Fix sidebar icon not visible\n- Auto close tags and brackets\n- better search and replace dialog\n- Added indent size setting\n- Added default mode setting\n- New icon\n- Disabled window tabbing") .font(Font.custom("CourierNewPSMT", size: 12)) .foregroundColor(themeTextColor) Spacer()