Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Enhance the <input> of the TimePicker #95

Closed
francoismassart opened this issue Nov 8, 2017 · 0 comments
Closed

Enhance the <input> of the TimePicker #95

francoismassart opened this issue Nov 8, 2017 · 0 comments

Comments

@francoismassart
Copy link
Contributor

francoismassart commented Nov 8, 2017

Version & browser

0.2.13 on most browsers

Which component

TimePicker

Steps to reproduce the problem

Editing the hours and minutes shows the default virtual keyboard on mobile devices...

Expected behavior

It would be nicer to benefit (when possible) from the new input types provided by HTML5.

Actual behavior

Currently the <input> used for HH and MM are not using the type attribute which fallbacks to the default aka type="text"

Proposed improvements coming in a PR

  • Use the type="number" which will cause the virtual keyboard to show up the number keys on Android mobile browsers. Browsers which do not support number input type will fallback to the default type which is text
  • Define the min and max values using the HTML5 attributes
  • Define the pattern attribute with the correct regular expression \d{1,2} the pattern doesn't seem to do much on Android browsers but is useful for iOS browsers
  • Add <style> hiding the native step up/down buttons (desktop browsers)
  • Ensuring we keep a "0" padding for values between 0 and 9

Please let me know if you have comments.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant