fix: force LTR for some text fields. #318

This commit is contained in:
CMK 2022-03-19 02:13:26 +08:00
parent 57f4dd9cd6
commit ad524b0172
2 changed files with 6 additions and 0 deletions

View File

@ -87,6 +87,8 @@ extension MastodonRegisterTextFieldTableViewCell {
textField.autocapitalizationType = .none
textField.attributedPlaceholder = nil
textField.isSecureTextEntry = false
textField.textAlignment = .natural
textField.semanticContentAttribute = .unspecified
let paddingRect = CGRect(x: 0, y: 0, width: 16, height: 10)
textField.leftView = UIView(frame: paddingRect)

View File

@ -55,6 +55,8 @@ extension MastodonRegisterViewModel {
cell.textField.keyboardType = .alphabet
cell.textField.autocorrectionType = .no
cell.textField.text = self.username
cell.textField.textAlignment = .left
cell.textField.semanticContentAttribute = .forceLeftToRight
NotificationCenter.default.publisher(for: UITextField.textDidChangeNotification, object: cell.textField)
.receive(on: DispatchQueue.main)
.compactMap { notification in
@ -94,6 +96,8 @@ extension MastodonRegisterViewModel {
cell.textField.autocorrectionType = .no
cell.textField.isSecureTextEntry = true
cell.textField.text = self.password
cell.textField.textAlignment = .left
cell.textField.semanticContentAttribute = .forceLeftToRight
NotificationCenter.default.publisher(for: UITextField.textDidChangeNotification, object: cell.textField)
.receive(on: DispatchQueue.main)
.compactMap { notification in