uhppoted / uhppoted-httpd

Browser based user interface for an access control system based on the UHPPOTE TCP/IP controllers
Other
4 stars 1 forks source link

[Enhancement] Cards | remove placeholder date for From and To inputs #32

Closed iKrushYou closed 2 months ago

iKrushYou commented 6 months ago

This was extremely confusing to me as a user that these were not default values (see https://github.com/uhppoted/uhppoted-httpd/issues/27). Instead, these fields should have no placeholder or a placeholder that is blank like mm/dd/yyyy to signify that it is not automatically filled with a value

Or, make the default value today. Because as it is currently, if you use the arrow keys it will act as if the value was null / 0. i.e. if you hit the up arrow on 2024 you get 0001 instead of 2025

image

Edit: I realize this is a Safari / WebKit issue. I just so happened to be using Chrome this time and see that it is not an issue / it is much more obvious the date isn't set

uhppoted commented 6 months ago

This was the best compromise found after experimenting across multiple browsers and multiple operating systems - the stock browser date/time controls are not great.

If you would like to replace them with a custom date/time control in your own version of the HTML it should be fairly straightforward.

twystd commented 2 months ago

Reopening to see if this Safari specific behaviour can be mitigated.

Notes

  1. The placeholder attribute is not mandated
  2. https://stackoverflow.com/questions/8430416/html5-date-field-and-placeholder-text-in-safari
  3. https://community.weweb.io/t/how-to-prevent-safari-from-using-todays-date-as-placeholder-on-a-date-component/1721
  4. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local

Mitigations:

twystd commented 2 months ago

Restyled card from/to date fields on Safari to dim fields if value is blank and no default start/end date is defined.

screenshot 2024-09-04 at 10 26 15
twystd commented 2 months ago

Added onchange event handler to update style while editing.

Closing as completed, pending release v0.8.9.