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

Error when use autoFocus in PinFieldAutoFill widget #237

Open
tigading opened this issue Jul 17, 2024 · 4 comments
Open

Error when use autoFocus in PinFieldAutoFill widget #237

tigading opened this issue Jul 17, 2024 · 4 comments

Comments

@tigading
Copy link

Please help me fix this issue

The following StateError was thrown while dispatching notifications for FocusNode:
Bad state: No element

When the exception was thrown, this was the stack: 
#0      List.single (dart:core-patch/growable_array.dart:353:22)
#1      TextPainter.getFullHeightForCaret (package:flutter/src/painting/text_painter.dart:1356:122)
#2      RenderEditable.getLocalRectForCaret (package:flutter/src/rendering/editable.dart:1801:48)
#3      EditableTextState._updateComposingRectIfNeeded (package:flutter/src/widgets/editable_text.dart:4487:38)
#4      EditableTextState._schedulePeriodicPostFrameCallbacks (package:flutter/src/widgets/editable_text.dart:4393:5)
#5      EditableTextState._openInputConnection (package:flutter/src/widgets/editable_text.dart:3594:7)
#6      EditableTextState._openOrCloseInputConnectionIfNeeded (package:flutter/src/widgets/editable_text.dart:3628:7)
#7      EditableTextState._handleFocusChanged (package:flutter/src/widgets/editable_text.dart:4329:5)
#8      ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:433:24)
#9      FocusNode._notify (package:flutter/src/widgets/focus_manager.dart:1090:5)
#10     FocusManager.applyFocusChangesIfNeeded (package:flutter/src/widgets/focus_manager.dart:1850:12)
(elided 2 frames from dart:async)
The FocusNode sending notification was: FocusNode#511d0([PRIMARY FOCUS])
  context: Focus
  PRIMARY FOCUS
@joknjokn
Copy link

@jaumard Would it be possible to treat this with high priority? Autofocus for the pin input field is not working, and it's really affecting UX. On top of that, our error logging is flooded with the error tigading mentions.

@joknjokn
Copy link

I believe this is related, btw: #239 (comment)

@MrSonyDeveloper
Copy link

Is there any work underway to resolve this issue?

@RedUp1024
Copy link

Is there any work underway to resolve this issue?

Hello, got same issue.
Fix: you need to upgrade package version to latest and then spell "flutter pub upgrade" for upgrade depended package "pin_input_text_field: " to 4.5.2, cause error inside depended package

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

4 participants