chore: only trigger onPaste callback when text left increases by >1 character (#2046)
This commit is contained in:
parent
c9dbbe73b8
commit
714613f871
2 changed files with 2 additions and 2 deletions
|
|
@ -66,7 +66,7 @@ class Choreographer {
|
|||
InputPasteListener(
|
||||
_textController,
|
||||
// TODO, do something on paste
|
||||
() {},
|
||||
() => debugPrint("on paste"),
|
||||
);
|
||||
itController = ITController(this);
|
||||
igc = IgcController(this);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class InputPasteListener {
|
|||
if (controller.editType != EditType.keyboard) return;
|
||||
final difference =
|
||||
controller.text.characters.length - _currentText.characters.length;
|
||||
if (difference.abs() > 1) onPaste();
|
||||
if (difference > 1) onPaste();
|
||||
_currentText = controller.text;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue