diff --git a/Modules/Sources/Browse/UI/Components/InputAlertView.swift b/Modules/Sources/Browse/UI/Components/InputAlertView.swift index a1c1b36..4b5157d 100644 --- a/Modules/Sources/Browse/UI/Components/InputAlertView.swift +++ b/Modules/Sources/Browse/UI/Components/InputAlertView.swift @@ -118,10 +118,16 @@ extension InputAlertView { // MARK: UITextFieldDelegate - func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { + func textField( + _ textField: UITextField, + shouldChangeCharactersIn range: NSRange, + replacementString string: String + ) -> Bool { component.textFieldString = { if let text = textField.text as NSString? { - return text.replacingCharacters(in: range, with: string) + return text + .replacingCharacters(in: range, with: string) + .trimmingCharacters(in: .newlines) } else { return .empty }