fleather
fleather copied to clipboard
Starting rich text with a divider breaks ability for rich text to expand
Steps to Reproduce
- Create a normal FleatherField
- Before typing anycharacters, insert a horizontal rule
- Continue to type as per normal, creating new lines
- Notice that the text field does not expand
Environment
OS: iOS/Web/Android Flutter version: 3.24 Fleather version: 1.18.0
I see an exception being thrown if I put the horizontal rule as the first element in the field, maybe that's the reason?
======== Exception caught by rendering library =====================================================
The following _TypeError was thrown during performLayout():
Null check operator used on a null value
When the exception was thrown, this was the stack:
#0 RenderEditableTextLine.computeDistanceToActualBaseline (package:fleather/src/rendering/editable_text_line.dart:634:55)
#1 RenderBox.getDistanceToActualBaseline.<anonymous closure> (package:flutter/src/rendering/box.dart:2507:26)
#2 _Baseline.memoize.ifAbsent (package:flutter/src/rendering/box.dart:1086:42)
#3 _LinkedHashMapMixin.putIfAbsent (dart:_compact_hash:673:23)
#4 _Baseline.memoize (package:flutter/src/rendering/box.dart:1087:18)
#5 RenderBox._computeWithTimeline (package:flutter/src/rendering/box.dart:1619:32)
#6 RenderBox._computeIntrinsics (package:flutter/src/rendering/box.dart:1596:26)
#7 RenderBox.getDistanceToActualBaseline (package:flutter/src/rendering/box.dart:2503:12)
....
This is the null check operator that throws: https://github.com/fleather-editor/fleather/blob/88a338cba10a4dc2fae53a36d2f4517bb026bcf7/packages/fleather/lib/src/rendering/editable_text_line.dart#L634