From f769b436f33078f0591c6af294744240cee15adb Mon Sep 17 00:00:00 2001 From: eToledo Date: Wed, 12 Aug 2020 09:01:38 +0200 Subject: [PATCH 1/2] [RNAztec iOS] Forcing minimum height to be equal to placeholder's height --- .../ios/RNTAztecView/RCTAztecView.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift b/packages/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift index 1ca29d4987efc7..946f2bb05e9681 100644 --- a/packages/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift +++ b/packages/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift @@ -134,7 +134,7 @@ class RCTAztecView: Aztec.TextView { delegate = self textContainerInset = .zero contentInset = .zero - textContainer.lineFragmentPadding = 0 + textContainer.lineFragmentPadding = 0 addPlaceholder() textDragInteraction?.isEnabled = false storage.htmlConverter.characterToReplaceLastEmptyLine = Character(.zeroWidthSpace) @@ -197,6 +197,14 @@ class RCTAztecView: Aztec.TextView { } } + override func sizeThatFits(_ size: CGSize) -> CGSize { + // Set the Placeholder height as the minimum TextView height. + let minimumHeight = placeholderLabel.frame.height + let fittingSize = super.sizeThatFits(size) + let height = max(fittingSize.height, minimumHeight) + return CGSize(width: fittingSize.width, height: height) + } + func updateContentSizeInRN() { let newSize = sizeThatFits(frame.size) From 022e0f4754f1e6a8bbecfff8c7f5d2ea184767fd Mon Sep 17 00:00:00 2001 From: eToledo Date: Wed, 12 Aug 2020 09:52:45 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- packages/react-native-editor/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native-editor/CHANGELOG.md b/packages/react-native-editor/CHANGELOG.md index d9372ce8be0c7b..41739d73027784 100644 --- a/packages/react-native-editor/CHANGELOG.md +++ b/packages/react-native-editor/CHANGELOG.md @@ -13,6 +13,7 @@ For each user feature we should also add a importance categorization label to i ## 1.35.0 +* [***] Fixed empty text fields on RTL layout. Now they are selectable and placeholders are visible. * [**] Add settings to allow changing column widths * [**] Media editing support in Gallery block.