Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS crash when deleting a chip with the keyboard #1

Closed
Axort opened this issue Jan 10, 2019 · 7 comments
Closed

iOS crash when deleting a chip with the keyboard #1

Axort opened this issue Jan 10, 2019 · 7 comments

Comments

@Axort
Copy link

Axort commented Jan 10, 2019

Works great! But there's an issue (only in iOS):
When pressing the keyboard's delete key after a chip, the app crashes. This is the log:

*** First throw call stack:
(
0   CoreFoundation                      0x0000000105aa91bb __exceptionPreprocess + 331
1   libobjc.A.dylib                     0x0000000105047735 objc_exception_throw + 48
2   CoreFoundation                      0x0000000105aa9015 +[NSException raise:format:] + 197
3   CoreFoundation                      0x00000001059f12d3 -[__NSCFString substringWithRange:] + 163
4   UIKitCore                           0x000000010eaccc6e -[TIDocumentState(UITextInputAdditions) copyTextInRange:fromDocument:] + 92
5   UIKitCore                           0x000000010eacd620 -[TIDocumentState(UITextInputAdditions) initWithDocument:contextBoundary:] + 599
6   UIKitCore                           0x000000010eaccab9 +[TIDocumentState(UITextInputAdditions) documentStateOfDocument:] + 69
7   UIKitCore                           0x000000<…>

I think is a Flutter issue and not a problem with this package because I can replicate this in any TextField when trying to delete this >`< character. But I don't know if you have noticed this and if you know the solution to this crash.

Thanks!

@ruhanijeb
Copy link

i am also facing the same issue

@taljacobson
Copy link

does this issue still exist?

@agordeev
Copy link

Yes, it does.
Is there any way to prevent the user from deleting symbols by keyboard? This issue is actually a blocker from using the package in any real app on iOS.

@dgsc-fav
Copy link
Contributor

dgsc-fav commented Sep 22, 2019

Disabling composing in the TextEditingValue stops the crash on iOS.

void _updateTextInputState() {
    final text = String.fromCharCodes(_chips.map((_) => kObjectReplacementChar));
    _value = TextEditingValue(
      text: text,
      selection: TextSelection.collapsed(offset: text.length),
      //composing: TextRange(start: 0, end: text.length),
    );
    if (_connection == null) _connection = TextInput.attach(this, TextInputConfiguration());
    _connection.setEditingState(_value);
  }

dgsc-fav referenced this issue in dgsc-fav/flutter_chips_input Sep 22, 2019
danvick added a commit that referenced this issue Sep 23, 2019
fix: iOS crash when deleting a chip with the keyboard #1
@danvick
Copy link
Owner

danvick commented Sep 24, 2019

Hi all,
Kindly confirm if this issue is fixed, I've merged a fix by @dgsc-fav.

hoxa-k pushed a commit to hoxa-k/flutter_chips_input that referenced this issue Apr 28, 2021
danvick pushed a commit that referenced this issue May 25, 2021
* nullsafety + fix errors

* fix for IOS crash #1

* fix invalid composing start

* return from fix

* fix composing

* fix keyboard appear

* fix for ios

* fix composing for android

Co-authored-by: Kulikova Natalia <kulikova_n@tass.ru>
@jameslester2004
Copy link

jameslester2004 commented Dec 9, 2021

Hi, looks like this has been fixed. I recommend removing the issue from the Package home page, as it looks like it is still a problem?

@dlgrmstf
Copy link

dlgrmstf commented Apr 21, 2022

Hi all,
one character write keyboard disappears on ios.

nlfiedler referenced this issue in nlfiedler/choose_input_chips Mar 13, 2023
…der_option

Add box decoration to suggestions box
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants