Crazelu / fluttertagger

A Flutter package that allows for the extension of TextFields to provide tagging capabilities (e.g @ user mentions and # hashtags).
MIT License
38 stars 16 forks source link

When manually selecting text and choosing "Select All," an error occurs. #12

Closed LiangLuDev closed 1 month ago

LiangLuDev commented 2 months ago

Range end 15 is out of text of length 14 'package:flutter/src/services/text_input.dart': Failed assertion: line 968 pos 12: 'range.end >= 0 && range.end <= text.length'

Crazelu commented 1 month ago

Nice catch @LiangLuDev! I'm able to reproduce the issue and isolate the cause. I was erroneously adding an extra space from _buildTextSpan in FlutterTaggerController which makes the text length greater than the valid selection range by 1.

This should be fixed in the next version.

Crazelu commented 1 month ago

@LiangLuDev this is now fixed in v2.2.1. I'll be closing this now.