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
Double Datepicker raised #46
Comments
flutter > 1.5.4-hotfix.2 |
Can confirm this occurs in Flutter version 1.7.8+hotfix3 |
I have been doing some digging about & testing... It looks like the code is listening to changes on both the focus node and text controller so there are multiple entries to the function that opens the date picker. Here is the referenced code:
What is more interesting... If I waited before clicking on the datetime picker (by click I mean a fairly quick mouse down + mouse up) but after waiting ~3 seconds after closing the datepicker before starting again I could get it to replicate. HOWEVER - this was only replicatable AFTER I had set a value AND AFTER I hit the reset icon (although this does throw an exception) :
Perhaps it is related to the exception? The widget may likely be in some broken state? |
Yes, but even in 1.5.4 in some cases.
Can you fix issue?
Best Regards
Il Dom 14 Lug 2019, 00:12 Nick Cullen <notifications@github.com> ha scritto:
… Can confirm this occurs in Flutter version 1.7.8+hotfix3
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#46?email_source=notifications&email_token=ADLHTN7QEBCBWCLRS3YS2FLP7JHODA5CNFSM4ICCSLH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ32JXA#issuecomment-511157468>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADLHTN2G6MRG46VTTW3SFULP7JHODANCNFSM4ICCSLHQ>
.
|
No i not have any exceptions, but in First Time calendar open keyboard, in
next is closed. I got a video to show problem.
Il Dom 14 Lug 2019, 00:29 Nick Cullen <notifications@github.com> ha scritto:
… I have been doing some digging about & testing... It looks like the code
is listening to changes on both the focus node and text controller so there
are multiple entries to the function that opens the date picker. Here is
the referenced code:
@OverRide
void initState() {
super.initState();
widget.focusNode.addListener(inputChanged);
widget.controller.addListener(inputChanged);
}
@OverRide
void dispose() {
widget.controller.removeListener(inputChanged);
widget.focusNode.removeListener(inputChanged);
super.dispose();
}
void inputChanged() {
final bool requiresInput = widget.controller.text.isEmpty &&
_previousValue.isEmpty &&
widget.focusNode.hasFocus;
if (requiresInput) {
getDateTimeInput(context, widget.initialDate, widget.initialTime)
.then(_setValue);
} else if (widget.resetIcon != null &&
widget.controller.text.isEmpty == showResetIcon) {
setState(() => showResetIcon = !showResetIcon);
// widget.focusNode.unfocus();
}
_previousValue = widget.controller.text;
if (!widget.focusNode.hasFocus) {
setValue(_toDate(_previousValue, widget.format));
} else if (!requiresInput && !widget.editable) {
var date = _toDate(_previousValue, widget.format);
getDateTimeInput(context, date ?? widget.initialDate,
_toTime(date) ?? widget.initialTime)
.then(_setValue);
}
}
What is more interesting... If I waited before clicking on the datetime
picker (by click I mean a fairly quick mouse down + mouse up) but after
waiting ~3 seconds after closing the datepicker before starting again I
could get it to replicate.
HOWEVER - this was only replicatable AFTER I had set a value AND AFTER I
hit the reset icon (although this does throw an exception) :
I/flutter (15494): ══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
I/flutter (15494): The following assertion was thrown while handling a gesture:
I/flutter (15494): invalid text selection: TextSelection(baseOffset: 10, extentOffset: 10, affinity:
I/flutter (15494): TextAffinity.upstream, isDirectional: false)
I/flutter (15494):
I/flutter (15494): When the exception was thrown, this was the stack:
I/flutter (15494): #0 TextEditingController.selection=
package:flutter/…/widgets/editable_text.dart:169
I/flutter (15494): #1 EditableTextState._handleSelectionChanged
package:flutter/…/widgets/editable_text.dart:1216
I/flutter (15494): #2 RenderEditable._handlePotentialSelectionChange
package:flutter/…/rendering/editable.dart:369
I/flutter (15494): #3 RenderEditable.selectPositionAt
package:flutter/…/rendering/editable.dart:1416
I/flutter (15494): #4 RenderEditable.selectPosition
package:flutter/…/rendering/editable.dart:1388
I/flutter (15494): #5 _TextFieldState._handleSingleTapUp
package:flutter/…/material/text_field.dart:770
I/flutter (15494): #6 _TextSelectionGestureDetectorState._handleTapUp
package:flutter/…/widgets/text_selection.dart:944
I/flutter (15494): #7 TapGestureRecognizer._checkUp.<anonymous closure>
package:flutter/…/gestures/tap.dart:363
I/flutter (15494): #8 GestureRecognizer.invokeCallback
package:flutter/…/gestures/recognizer.dart:182
I/flutter (15494): #9 TapGestureRecognizer._checkUp
package:flutter/…/gestures/tap.dart:363
I/flutter (15494): #10 TapGestureRecognizer.acceptGesture
package:flutter/…/gestures/tap.dart:312
I/flutter (15494): #11 _TransparentTapGestureRecognizer.rejectGesture
package:flutter/…/widgets/text_selection.dart:1146
I/flutter (15494): #12 GestureArenaManager.sweep
package:flutter/…/gestures/arena.dart:159
I/flutter (15494): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent
package:flutter/…/gestures/binding.dart:222
I/flutter (15494): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent
package:flutter/…/gestures/binding.dart:198
I/flutter (15494): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent
package:flutter/…/gestures/binding.dart:156
I/flutter (15494): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue
package:flutter/…/gestures/binding.dart:102
I/flutter (15494): #17 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket
package:flutter/…/gestures/binding.dart:86
I/flutter (15494): #21 _invoke1 (dart:ui/hooks.dart:250:10)
I/flutter (15494): #22 _dispatchPointerDataPacket (dart:ui/hooks.dart:159:5)
I/flutter (15494): (elided 3 frames from package dart:async)
I/flutter (15494):
I/flutter (15494): Handler: "onTapUp"
I/flutter (15494): Recognizer:
I/flutter (15494): _TransparentTapGestureRecognizer#1273d
I/flutter (15494): ════════════════════════════════════════════════════════════════════════════════════════════════════
Perhaps it is related to the exception? The widget may likely be in some
broken state?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#46?email_source=notifications&email_token=ADLHTN5XZBOA5YKH5VAHSXTP7JJNZA5CNFSM4ICCSLH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ32QOA#issuecomment-511158328>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADLHTNYQEANW4HQDKU34KNDP7JJNZANCNFSM4ICCSLHQ>
.
|
Il Dom 14 Lug 2019, 00:12 Nick Cullen <notifications@github.com> ha scritto:
… Can confirm this occurs in Flutter version 1.7.8+hotfix3
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#46?email_source=notifications&email_token=ADLHTN7QEBCBWCLRS3YS2FLP7JHODA5CNFSM4ICCSLH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ32JXA#issuecomment-511157468>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADLHTN2G6MRG46VTTW3SFULP7JHODANCNFSM4ICCSLHQ>
.
|
This should be fixed in v0.3.0. |
Ok. When? |
After update i have this effect Gray...
Il Dom 14 Lug 2019, 22:37 Jacob Phillips <notifications@github.com> ha
scritto:
… This should be fixed in v0.3.0.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#46?email_source=notifications&email_token=ADLHTN3BTYTF4TKTJUHX4CTP7OFCLA5CNFSM4ICCSLH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ4M4DI#issuecomment-511233549>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADLHTNZ3B7UKTJHE3QL7VTLP7OFCLANCNFSM4ICCSLHQ>
.
|
DateTimePickerFormField(
firstDate: DateTime.now(),
inputType: InputType.date,
format: DateFormat('dd-MM-yyyy'),
editable: false,
validator: (DateTime value) {
if (value == null) {
return 'Data obbligatoria';
} else {
widget.orderDate = value;
}
},
decoration:
InputDecoration(labelText: 'Data *', hasFloatingPlaceholder: false),
);
this is raised two or many times at open.
The text was updated successfully, but these errors were encountered: