fleather icon indicating copy to clipboard operation
fleather copied to clipboard

Starting rich text with a divider breaks ability for rich text to expand

Open kane-knowby opened this issue 1 year ago • 1 comments

Steps to Reproduce

  1. Create a normal FleatherField
  2. Before typing anycharacters, insert a horizontal rule
  3. Continue to type as per normal, creating new lines
  4. Notice that the text field does not expand

CleanShot 2024-09-11 at 14 12 37@2x

Environment

OS: iOS/Web/Android Flutter version: 3.24 Fleather version: 1.18.0

kane-knowby avatar Sep 11 '24 04:09 kane-knowby

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

symphonybiz avatar Mar 26 '25 16:03 symphonybiz