Skip to content

Commit a3580a9

Browse files
committed
Fix breaking layout on slow window resizing.
1 parent 4aabe35 commit a3580a9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,17 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
452452
isViewInitialized = true
453453
}
454454

455+
override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
456+
// layout is changing when app screen is resized (on Chromebooks, etc.)
457+
// we need to refresh text to reflect visual changes
458+
if (changed) {
459+
post {
460+
refreshText(false)
461+
}
462+
}
463+
super.onLayout(changed, left, top, right, bottom)
464+
}
465+
455466
// Setup the keyListener(s) for Backspace and Enter key.
456467
// Backspace: If listener does return false we remove the style here
457468
// Enter: Ask the listener if we need to insert or not the char

0 commit comments

Comments
 (0)