Skip to content

[Web] getWordBoundary does not work in html mode #113234

@chunhtai

Description

@chunhtai

flutter/engine@5956aa6 missed the html version of the text.dart

This test should pass, if the html version is patched

  test('getWordBoundary test', () {
    const String text = 'how are you';
    final RenderParagraph paragraph = RenderParagraph(
      const TextSpan(text: text),
      textDirection: TextDirection.ltr,
    );
    layout(paragraph);

    TextRange range = paragraph.getWordBoundary(const TextPosition(offset: 2));
    expect(range.textInside(text), equals('how'));

    range = paragraph.getWordBoundary(const TextPosition(offset: 3, affinity: TextAffinity.upstream));
    expect(range.textInside(text), equals('how'));
  });

Metadata

Metadata

Assignees

Labels

a: tests"flutter test", flutter_test, or one of our testsplatform-webWeb applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions