Skip to content

Commit eeace3d

Browse files
authored
[iOS]Fix: Oddly formatted text hangs Gutenberg (#1352)
* Enable batch editing on font change * Remove unnecessary `removeAttribute` call
1 parent 6f1647d commit eeace3d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

react-native-aztec/ios/RNTAztecView/RCTAztecView.swift

+2
Original file line numberDiff line numberDiff line change
@@ -508,12 +508,14 @@ class RCTAztecView: Aztec.TextView {
508508

509509
let fullRange = NSRange(location: 0, length: textStorage.length)
510510

511+
textStorage.beginEditing()
511512
textStorage.enumerateAttributes(in: fullRange, options: []) { (attributes, subrange, stop) in
512513
let oldFont = font(from: attributes)
513514
let newFont = applyFontConstraints(to: oldFont)
514515

515516
textStorage.addAttribute(.font, value: newFont, range: subrange)
516517
}
518+
textStorage.endEditing()
517519

518520
refreshTypingAttributesAndPlaceholderFont()
519521
}

0 commit comments

Comments
 (0)