iOS Delete Key Not Working - UI Not Updating Despite onChanged Callback Firing labels: bug, ios
UI shows "89900" instead of "8990" after delete key press.
Pinput version: 5.0.2
Result of: flutter doctor --verbose
[✓] Xcode - develop for iOS and macOS (Xcode 26.0.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 17A400 • CocoaPods version 1.16.2
[✓] Connected device (3 available) • iPhone 17 Pro Max (mobile) • 5CBFC9B6-8DD9-4216-84B1-E452A0C17A4F • ios • com.apple.CoreSimulator.SimRuntime.iOS-26-0 (simulator)
Smartphone (please complete the following information):
- Device: iPhone 17 Pro Max (Simulator)
- OS: iOS 26.0
- Browser: N/A (Flutter app)
- Version: N/A
Code Sample
Pinput(
key: const Key('confirmCodeInput'),
onCompleted: (value) {
if (value.length == 6) {
_checkCode();
}
},
onChanged: (value) {
print('PIN changed: $value'); // This fires correctly
setState(() {}); // This doesn't help
},
length: 6,
autofocus: true,
focusNode: _otpFocus,
controller: _otpController,
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
enableInteractiveSelection: true,
separatorBuilder: (_) => Dimensions.kGap8,
crossAxisAlignment: CrossAxisAlignment.center,
hapticFeedbackType: HapticFeedbackType.lightImpact,
defaultPinTheme: defaultPinTheme,
submittedPinTheme: defaultPinTheme,
focusedPinTheme: defaultPinTheme.copyDecorationWith(
border: Border.all(color: context.colorScheme.primary, width: 1.5),
),
errorPinTheme: defaultPinTheme.copyDecorationWith(
border: Border.all(color: context.colorScheme.error)
),
)
Additional context
- The issue only occurs on iOS platform
- Android works correctly
- The
onChangedcallback receives the correct updated values - Controller is properly connected and receives updates
- Tried various workarounds including manual controller updates and
WidgetsBinding.instance.addPostFrameCallback - Issue persists across different iOS versions (tested on iOS 26.0 simulator)
- This appears to be a visual synchronization issue between the controller and the UI rendering
Expected Behavior
When the delete key is pressed, the UI should visually update to reflect the removed digit, matching the value received in the onChanged callback.
Actual Behavior
The onChanged callback fires with the correct updated value, but the visual PIN input fields remain unchanged, showing the previous state.
The same problem. I can delete only 2 right numbers.
- sdk: ^3.9.2
- pinput: ^5.0.2
https://github.com/user-attachments/assets/dc503999-831a-4b77-9d9c-88e16133e326
Same here
I’ve fixed the issue in the flutter_pinput (v ^1.0.2) package. Tagging @justplayd and @KonstantinDubrouski so you’re aware of the update.
I’ve fixed the issue in the flutter_pinput (v ^1.0.2) package. Tagging @justplayd and @KonstantinDubrouski so you’re aware of the update.
thanks
Same here
Fixed in version 6.0.0
Fixed in version 6.0.0
thanks
please close this issue as it's fixed