-
Notifications
You must be signed in to change notification settings - Fork 125
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
Blocked input on Samsung devices #51
Comments
Hey! I have a similar problem. :( Only in Samsung devices, when trying update the mask, keyboard freezes I did a example. import 'package:flutter/material.dart';
import 'package:flutter_masked_text/flutter_masked_text.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
MaskedTextController _controller;
@override
void initState() {
_controller = MaskedTextController(mask: "(00) 0000-0000", text: "");
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
TextField(
keyboardType: TextInputType.number,
controller: _controller,
onChanged: (newValue) {
if (newValue.length >= 15) {
_controller.updateMask("(00) 00000-0000");
} else {
_controller.updateMask("(00) 0000-0000");
}
_controller.updateText(newValue);
},
),
],
),
),
);
}
}
Flutter Dotcor
|
Maybe this issue have associate with this https://github.com/flutter/flutter/issues/42273 |
@Giuliano-Stravini hi, I have the same problem (on Samsung Note 8). I'm using Flutter Channel stable, v1.17.0 If I use TextFormField without MoneyMaskedTextController, it will be okay. How can MoneyMaskedTextController cause the lagging? Do you know? Have you fixed your problem yet? |
Hi @QkLahpita, Unfortunately, not yet |
This issue has been resolved? |
Same problem here. Any updates? |
same problem, delay in samsung devices. |
same here, delay input in samsung devices's keyboard |
The code below blocks input on Samsung phones:
final mmTextController = MoneyMaskedTextController(
decimalSeparator: DecimalSeparator,
thousandSeparator: ThousandSeparator,
precision: precision,
);
mmTextController.afterChange = (String maskedValue, double rawValue) {
// the line below blocks any further input on Samsung phones
mmTextController.selection = TextSelection.collapsed(offset: mmTextController.text.length);
};
The text was updated successfully, but these errors were encountered: