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

Refactor datepicker #744

Merged
merged 6 commits into from
Nov 2, 2023
Merged

Refactor datepicker #744

merged 6 commits into from
Nov 2, 2023

Conversation

Grafikart
Copy link
Collaborator

@Grafikart Grafikart commented Oct 30, 2023

Refactor of the datepicker component to use 3 number field instead of the native datepicker from the browser.

Behaviour

I tried to simulate the behaviour of the native datepicker :

  • When a field is focused, the whole text is selected to simplify input
  • If an invalid or incomplete date is entered, onChange is called with a null value (invalid or incomplete = no value)
  • Initial 0 are stripped since we use number input (we could switch to text input)
  • It supports the 3 format "YYYY-MM-DD", "YYYY-MM" and "YYYY"

Appearance

image

It's unstyled here since I don't load the lunatic CSS for this story.

Fix #141

@Grafikart Grafikart changed the base branch from main to 2.7 October 30, 2023 14:20
Copy link

sonarcloud bot commented Nov 2, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@laurentC35 laurentC35 merged commit 91b049d into 2.7 Nov 2, 2023
15 of 16 checks passed
@laurentC35 laurentC35 deleted the ref/datepicker branch November 2, 2023 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Datepicker : new components ?
2 participants