Issue 11910

Title
DateTime fields not working on Firefox when no time is set
Priority
bug
Status
testing
Nosy list
ced, pokoli, yangoon
Assigned to
pokoli
Keywords
backport, review

Created on 2022-11-23.10:59:36 by pokoli, last changed 6 days ago by ced.

Messages

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-11-23.15:02:11

I really do not like the complexification of the code for something that Firefox should implement and indeed a time picker exist in FF but it is just disabled.
Now this option does not activate one for datetime-local but there is a bug opened.

Indeed I would prefer to always use the proper input type and activate/disable it if it can not be currently used for edition. The best would be to get a way to know if a picker is available and if it is complete but I do not think it is doable. So I guess for time picker we could put a tooltip that explain why it is not available and how to activate it. And for datetime-local maybe we could set today to the input if it is opened and the value is empty but only on FF.

Any way this will be only temporary because a fix is on the way.

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2022-11-23.14:34:23

El 23/11/22 a les 13:23, C├ędric Krier ha escrit:

I do not like this proposal because as you said opening the popup will loose the existing time which is for me worst than not editing.

I updated the review to keep the time when updating the field.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-11-23.13:23:51

I do not like this proposal because as you said opening the popup will loose the existing time which is for me worst than not editing.

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2022-11-23.13:17:10

Thanks I now fully understood the problem, I will describe it:

Currently in firefox we have a datetime-local widget which can only set the date value so the value is never propagated (firefox does not trigger the change event) to the text input as is still missing the time part but it is not possible for the user to set such value. This prevents setting any value to the widget using the picker when no time is set. It only allows to edit the date part when a time is set.

As as workarround I propose use a date input for the widget on firefox. This will allow the user to just set the date part and then manually set the time. This has the drawback that the time part is lost when updating the date via the widget but as the user sees the change on the text input and can update it it seems like a reasonable behaviour. The positive part is that the user can set a value when the input has no time.

Here is review413951003 which implements this behaviour just for firefox.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-11-23.12:17:37

datetime-local input can not work because it is too simple: no support for seconds, not support for custom format, etc.

We can not retrieve a datetime value from the input if a time was not set. And Firefox as it does not have a time selector popup, does not set one.
But it will be also wrong to set a value when the input is clicked because it will prevent the user to not select a value.
So for me nothing can be done to improve that except for Firefox to implement a time selection or as we do for time to not display a button on Firefox (but I think the trade-off is in favor of keeping it as it work once a time is set).

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2022-11-23.11:43:44

I just found that the widgets are working correctly on firefox and chrome. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local

The problem is that we have a role of button to it and using a text widget to have its value. (Same happens for date widgets).
This makes the datetime-local widget no usable on firefox. Once a value is selected the text field is not updated and the field is never stored on the server (because missing time).

Only difference is that firefox does not have a time widget selector (while chrome has). I think that should not make the difference and we should stick to using the same design on all browsers and let them implement such selector widgets on the future.

For me we should remove the text field and use the plain widgets to make them work.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-11-23.11:41:27

Firefox does not provide a time selection popup.

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2022-11-23.10:59:36

When adding a datetime field on firefox (tested on Firefox 106) a field with a calendar is show. When clicking the calendar only a date widget is shown but not time is shown.
Clicking on it does not set any value.

When using chromium the field works as expected.

I see that chromium uses datetime-local input but this is not the behaviour on firefox.
As far as I see firefox already supports such widget from since version 93.

History
Date User Action Args
2022-11-23 15:02:11cedsetmessages: + msg80148
2022-11-23 14:34:23pokolisetkeyword: + review
messages: + msg80147
reviews: 413951003
2022-11-23 13:23:51cedsetmessages: + msg80146
2022-11-23 13:17:10pokolisetkeyword: + backport
messages: + msg80145
status: chatting -> testing
2022-11-23 12:29:08yangoonsetnosy: + yangoon
2022-11-23 12:17:38cedsetmessages: + msg80144
title: DateTime fields not working on Firefox -> DateTime fields not working on Firefox when no time is set
2022-11-23 11:43:52pokolisetstatus: unread -> chatting
2022-11-23 11:43:44pokolisetassignedto: pokoli
messages: + msg80143
status: closed -> unread
2022-11-23 11:41:27cedsetmessages: + msg80141
nosy: + ced
status: unread -> closed
2022-11-23 10:59:36pokolicreate

Showing 10 items. Show all history (warning: this could be VERY long)