From fd16b74b65aea02747538c547d713669ba6e582a Mon Sep 17 00:00:00 2001 From: Eric Jensen Date: Sun, 11 Oct 2020 12:30:42 -0700 Subject: [PATCH] Add the ability to set the TextView's KeyboardDismissMode --- Sources/TextView/TextView.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/TextView/TextView.swift b/Sources/TextView/TextView.swift index 7c0cae8..c6152b7 100644 --- a/Sources/TextView/TextView.swift +++ b/Sources/TextView/TextView.swift @@ -48,6 +48,7 @@ public struct TextView: View { private let contentType: ContentType? private let autocorrection: Autocorrection private let autocapitalization: Autocapitalization + private let keyboardDismissMode: UIScrollView.KeyboardDismissMode private let isSecure: Bool private let isEditable: Bool private let isSelectable: Bool @@ -69,6 +70,7 @@ public struct TextView: View { contentType: ContentType?, autocorrection: Autocorrection, autocapitalization: Autocapitalization, + keyboardDismissMode: UIScrollView.KeyboardDismissMode, isSecure: Bool, isEditable: Bool, isSelectable: Bool, @@ -90,6 +92,7 @@ public struct TextView: View { self.contentType = contentType self.autocorrection = autocorrection self.autocapitalization = autocapitalization + self.keyboardDismissMode = keyboardDismissMode self.isSecure = isSecure self.isEditable = isEditable self.isSelectable = isSelectable @@ -131,6 +134,7 @@ public struct TextView: View { textView.textContentType = contentType textView.autocorrectionType = autocorrection textView.autocapitalizationType = autocapitalization + textView.keyboardDismissMode = keyboardDismissMode textView.isSecureTextEntry = isSecure textView.isEditable = isEditable textView.isSelectable = isSelectable @@ -178,6 +182,7 @@ public struct TextView: View { private let contentType: ContentType? private let autocorrection: Autocorrection private let autocapitalization: Autocapitalization + private let keyboardDismissMode: UIScrollView.KeyboardDismissMode private let isSecure: Bool private let isEditable: Bool private let isSelectable: Bool @@ -204,6 +209,7 @@ public struct TextView: View { contentType: ContentType? = nil, autocorrection: Autocorrection = .default, autocapitalization: Autocapitalization = .sentences, + keyboardDismissMode: UIScrollView.KeyboardDismissMode = .none, isSecure: Bool = false, isEditable: Bool = true, isSelectable: Bool = true, @@ -230,6 +236,7 @@ public struct TextView: View { self.contentType = contentType self.autocorrection = autocorrection self.autocapitalization = autocapitalization + self.keyboardDismissMode = keyboardDismissMode self.isSecure = isSecure self.isEditable = isEditable self.isSelectable = isSelectable @@ -257,6 +264,7 @@ public struct TextView: View { contentType: contentType, autocorrection: autocorrection, autocapitalization: autocapitalization, + keyboardDismissMode: keyboardDismissMode, isSecure: isSecure, isEditable: isEditable, isSelectable: isSelectable,