Merge branch 'main' into fix-crash-on-launch-tmp-no-nav

This commit is contained in:
Angelo Stavrow 2022-12-18 15:28:10 -05:00 committed by GitHub
commit 804255b1da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View File

@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [Mac] Fixed a bug where alerts weren't presented for login errors. - [Mac] Fixed a bug where alerts weren't presented for login errors.
- [Mac] Fixed some build warnings in the project. - [Mac] Fixed some build warnings in the project.
- [Mac] Bumped WriteFreely package to v0.3.6 to handle decoding of fractional seconds in dates. - [Mac] Bumped WriteFreely package to v0.3.6 to handle decoding of fractional seconds in dates.
- [iOS] Fixed a bug where posts were always shown in serif, even if the post was published with another font.
## [1.0.13-ios] - 2022-11-13 ## [1.0.13-ios] - 2022-11-13

View File

@ -17,17 +17,12 @@ private struct UITextViewWrapper: UIViewRepresentable {
textField.delegate = context.coordinator textField.delegate = context.coordinator
textField.isEditable = true textField.isEditable = true
textField.font = UIFont.preferredFont(forTextStyle: .body)
textField.isSelectable = true textField.isSelectable = true
textField.isUserInteractionEnabled = true textField.isUserInteractionEnabled = true
textField.isScrollEnabled = false textField.isScrollEnabled = false
textField.backgroundColor = UIColor.clear textField.backgroundColor = UIColor.clear
textField.smartDashesType = .no textField.smartDashesType = .no
let font = textStyle
let fontMetrics = UIFontMetrics(forTextStyle: .largeTitle)
textField.font = fontMetrics.scaledFont(for: font)
if nil != onDone { if nil != onDone {
textField.returnKeyType = .next textField.returnKeyType = .next
} }
@ -41,9 +36,15 @@ private struct UITextViewWrapper: UIViewRepresentable {
uiView.text = self.text uiView.text = self.text
} }
if uiView.window != nil, isEditing { let font = textStyle
let fontMetrics = UIFontMetrics(forTextStyle: .largeTitle)
uiView.font = fontMetrics.scaledFont(for: font)
if uiView.window != nil && isEditing {
DispatchQueue.main.async {
uiView.becomeFirstResponder() uiView.becomeFirstResponder()
} }
}
UITextViewWrapper.recalculateHeight(view: uiView, result: $calculatedHeight) UITextViewWrapper.recalculateHeight(view: uiView, result: $calculatedHeight)
} }