Skip to content
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

[pickers] Inform what shortcut is currently being selected #10120

Open
2 tasks done
marcpachecog opened this issue Aug 23, 2023 · 2 comments
Open
2 tasks done

[pickers] Inform what shortcut is currently being selected #10120

marcpachecog opened this issue Aug 23, 2023 · 2 comments
Labels
component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature

Comments

@marcpachecog
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Summary 💡

Will be a great enhancement to set the shortcut chip as selected if it match with the current dates. It will look like this:

Captura de Pantalla 2023-08-23 a las 12 58 12

Examples 🌈

No response

Motivation 🔦

No response

Order ID 💳 (optional)

No response

@marcpachecog marcpachecog added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 23, 2023
@zannager zannager added the component: pickers This is the name of the generic UI component, not the React module! label Aug 24, 2023
@flaviendelangle
Copy link
Member

@alexfauquette I like the idea

@flaviendelangle flaviendelangle changed the title [DatePickers] Inform what shortcut is currently being selected [pickers] Inform what shortcut is currently being selected Aug 24, 2023
@flaviendelangle flaviendelangle added enhancement This is not a bug, nor a new feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 24, 2023
@alexfauquette
Copy link
Member

I like it too, but the current proposal seems too difficult to support.

if it match with the current dates.

it means that for each change, we compare the new values with the shortcuts to know if one of them matches the new value. It can be problematic for a few reasons:

  • How to handle the comparison? If a dev controls values to set the hours to 12AM for some reason and the shortcut values are at 0AM, it will be buggy. Basically, we would need to create a comparison with granularity
  • What about complex shortcuts such as the next available week? If at some points shortcuts use the current value it will create a loop: the shortcut updates the value, and the value defines the shortcut.

I'm more in favor of a selected state if the shortcut gets pressed. and this selected state is removed when the value change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature
Projects
None yet
Development

No branches or pull requests

4 participants