getkirby / ideas

This is the backlog of ideas and feature requests from the last two years. Use our new feedback platform to post your new ideas or vote on existing ideas.
https://feedback.getkirby.com
20 stars 0 forks source link

Date field: remember selection before selecting `----` #272

Open neildaniels opened 5 years ago

neildaniels commented 5 years ago

Describe the bug If you load a page in the Panel that has a date field, if you change any one part of the field to "—" the entire field shows "—".

created:
  type: date

To Reproduce Steps to reproduce the behavior:

  1. Open a Panel page with a date field a value already present
  2. Change any part of the date field to "—" (such as month)

Expected behavior Only the month portion should show "—".

Screenshots ezgif-2-a6fbddfd6cfb

Kirby Version 3.1.3

Desktop (please complete the following information):

distantnative commented 5 years ago

Why would you expect only the month portion to show the null value? It makes sense to me that if you deselect one part of the date, you want the whole field to be deselected. Otherwise you would select an actual other month. In that way, the field also guarantees that its value is either none (null) or a valid actual state - not any invalid state.

neildaniels commented 5 years ago

Ah, that's very fair. I didn't consider the case where you want to actually deselect a date.

I guess it was weird to me that if you decide to reset one value, none of the other fields make any attempt to remember what they had stored in them in you "restore" the original value. They just always get reset to the "current" date.

For example, if you started with 2008 - 07 - 23

Then change the month value to .

I would expect that 2008 and 22 are remembered if I decide to re-select a month value.

But if you now select month 04, it shows 2019 - 04 - 02 (assuming today was 2019-05-02)

I would have expected to be 2008 - 04 - 23

Here's a mockup of that, if it was decided that this behavior should be made clear to the user. (But does admittedly give the impression that partial dates would be saved.) This mockup's values don't match my "story," but illustrates what I'm thinking.

Screen Shot 2019-05-02 at 7 49 39 PM

I wouldn't expect these values to persist across Panel refreshes (because, as you said, it doesn't make sense to save partial dates). But keeping it retained for those cases where you accidentally select instead of 01 this would be really handy.

distantnative commented 5 years ago

To be honest, this seems like a huge effort (implementation, where to store such remembered previous values, etc.) for very little benefit. However, just my opinion - others might differ. I am moving this to the idea repo as it is no bug and maybe others can upvote on this, if they also feel like you that this would be beneficial.