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

Blocked input on Samsung devices #51

Open
flaviup opened this issue Feb 3, 2020 · 9 comments
Open

Blocked input on Samsung devices #51

flaviup opened this issue Feb 3, 2020 · 9 comments

Comments

@flaviup
Copy link

flaviup commented Feb 3, 2020

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);
};

@Giuliano-Stravini
Copy link

Giuliano-Stravini commented Feb 13, 2020

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

[√] Flutter (Channel beta, v1.13.6, on Microsoft Windows [versão 10.0.18362.592], locale pt-BR)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
[√] Chrome - develop for the web
[√] Android Studio (version 3.4)
[√] VS Code (version 1.42.0)
[√] Connected device (3 available)

• No issues found!

@Giuliano-Stravini
Copy link

Maybe this issue have associate with this https://github.com/flutter/flutter/issues/42273

@Giuliano-Stravini
Copy link

I found this issue on Flutter Github.

@flaviup try change to master channel, maybe resolve your problem

@QkLahpita
Copy link

@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?

@Giuliano-Stravini
Copy link

Hi @QkLahpita,

Unfortunately, not yet

@machadoguilhermebr
Copy link

This issue has been resolved?

@zeucxb
Copy link

zeucxb commented Jul 29, 2020

Same problem here. Any updates?

@rodrigorafaeldamaceno
Copy link

same problem, delay in samsung devices.

@vcnt1
Copy link

vcnt1 commented Sep 4, 2020

same here, delay input in samsung devices's keyboard

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

7 participants