-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: changes for datetimepicker component #214
base: main
Are you sure you want to change the base?
Conversation
content/body/datetimepicker.php
Outdated
<div> | ||
<label> | ||
<span class="datetimepicker__select-label">Enter the travel date and time</span> | ||
<input placeholder="Select Date..." class="datetimepicker" /><!--datetimepicker input--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things:
- Let's remove the placeholder text. (Just because I don't want to showcase it, since a lot of people tend to use it instead of labels)
- We need an sr-only aria-describedby that gives keyboard instructions. Something like:
"Enter in YYYY-MM-DD format or use Control + Shift + Arrow Keys to change the date".
(I believe Control + Shift + Arrow works for all operating systems, correct?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Zoltan, I have added the aria-describedby and removed the placeholder text. I will discuss about the behaviour of Control + Shift + Arrow.
</thead> | ||
<tbody> | ||
<tr> | ||
<td>Up Arrow</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this work on mobile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As described in this article, When flatpickr detects a mobile browser, it turns the date input into a native date/time/datetime input. To disable this behaviour, I have set the property, disableMobile: "true".
After setting this property, the flatpicker has the consistent look and feel across all devices.
(https://flatpickr.js.org/mobile-support/). Let me know if you feel we should remove this property.
9c4fd9f
to
7403cbc
Compare
content/bottom/datetimepicker.php
Outdated
function initializeFlatpickr(language) { | ||
var fp = flatpickr(".datetimepicker", { | ||
enableTime: true, | ||
// disableMobile: true, // By default, Flatpicker shows the native HTML5 datepicker on mobile devices. To change this behavior and maintain a consistent appearance across all devices, set this property to true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zoltan-dulac , I have commented these two properties for now.
- disableMobile : true , disable native datetime inputs in all cases
- allowInput:true, // allows the user to enter date using keyboard
fb0ea13
to
8c58400
Compare
8c58400
to
4e865b5
Compare
4e865b5
to
25353a7
Compare
No description provided.