-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
flutter/engine
#23162Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsa: typographyText rendering, possibly libtxtText rendering, possibly libtxtplatform-webWeb applications specificallyWeb applications specifically
Description
The following test I'm trying to add only fails on web. And the only TextBox textPainter.getBoxesForSelection reports is [TextBox.fromLTRBD(0.0, 0.0, 0.0, 0.0, TextDirection.ltr)].
class FakeEditableTextState with TextSelectionDelegate {
@override
TextEditingValue textEditingValue = const TextEditingValue();
@override
void hideToolbar() { }
@override
void bringIntoView(TextPosition position) { }
}
test('more than 1 run on the same line', () {
final TextSelectionDelegate delegate = FakeEditableTextState();
final RenderEditable editable = RenderEditable(
maxLines: null,
textAlign: TextAlign.start,
textDirection: TextDirection.ltr,
offset: ViewportOffset.zero(),
textSelectionDelegate: delegate,
startHandleLayerLink: LayerLink(),
endHandleLayerLink: LayerLink(),
);
const TextStyle tinyText = TextStyle(fontSize: 1, fontFamily: 'Ahem');
const TextStyle normalText = TextStyle(fontSize: 10, fontFamily: 'Ahem');
editable.text = TextSpan(
children: <TextSpan>[
const TextSpan(text: 'A', style: tinyText),
TextSpan(text: 'A' * 20, style: normalText),
const TextSpan(text: 'A', style: tinyText)
],
);
// Give it a width that forces the editable to wrap.
editable.layout(const BoxConstraints.tightFor(width: 200));
final Rect composingRect = editable.getRectForComposingRange(const TextRange(start: 0, end: 20 + 2));
// Since the range covers an entire line, the Rect should also be almost
// as wide as the entire paragraph (give or take 1 character).
expect(composingRect?.width, greaterThan(200 - 10));
});
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsa: typographyText rendering, possibly libtxtText rendering, possibly libtxtplatform-webWeb applications specificallyWeb applications specifically