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

Fixes #150: Native date time widgets. #158

Merged
merged 1 commit into from
Apr 24, 2016
Merged

Conversation

n1k0
Copy link
Collaborator

@n1k0 n1k0 commented Apr 22, 2016

WiP, refs #150 /cc @kaihendry

This adds new native date and datetime widgets which are now used by default, and demotes previous default select-based date widgets as alternative ones.

Todo

  • Update docs
  • Write tests (hard as jsdom doesn't have a clue what these inputs are)

@n1k0 n1k0 force-pushed the 150-native-date-time-widgets branch from b68ec57 to 2361e30 Compare April 22, 2016 09:57
@n1k0
Copy link
Collaborator Author

n1k0 commented Apr 22, 2016

We should probably keep the select-based date widgets as default ones, as support of native ones isn't great across platforms just yet.

Edit: after discussing about that with @leplatrem, we decided to keep it this way.

properties: {
native: {
title: "Native",
description: "Note that a few browsers support these.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: May not work on some browsers could be enough ?

@leplatrem
Copy link
Contributor

FYI it works like a charm on Firefox mobile:

photo_2016-04-22_19-26-18
photo_2016-04-22_19-26-27

@n1k0 n1k0 force-pushed the 150-native-date-time-widgets branch from 7aa49ed to 025eacb Compare April 23, 2016 07:13
@almet
Copy link
Contributor

almet commented Apr 24, 2016

after discussing about that with @leplatrem, we decided to keep it this way.

Can we know what the turning point was?

As the default HTML5 date input doesn't work on almost all non-mobile platforms. I would suggest having something that works for all platforms by default instead.

@n1k0
Copy link
Collaborator Author

n1k0 commented Apr 24, 2016

Can we know what the turning point was?

Pushing and promoting Web standards.

@n1k0
Copy link
Collaborator Author

n1k0 commented Apr 24, 2016

Note: For Firefox, bug 825294 should land anytime soon. MSDN strangely declares it supported, so maybe it's just matter of time for it to land on a stable version?

@almet
Copy link
Contributor

almet commented Apr 24, 2016

Mouarf, pushing and promoting web standards is great, but we should make our library users aware that this will not work for most of their users, and probably propose an alternative solution.

@n1k0
Copy link
Collaborator Author

n1k0 commented Apr 24, 2016

we should make our library users aware that this will not work for most of their users, and probably propose an alternative solution

That's probably why I've added a specific section in the documentation along providing alternative widgets compatible with those other platforms.

@almet
Copy link
Contributor

almet commented Apr 24, 2016

Perfect! :)

- More formats could be supported in a near future, feel free to help us going faster!
- `date-time`: By default, an `input[type=datetime-local]` element is used; if you solely want to rely on a date, a `date` uiSchema alternative widget is available:

![](http://i.imgur.com/xqu6Lcp.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe imgur isn't a good place to host these images, as the pictures could disapear any time. Should we host them in this very repository instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no easy way to make github serving images hosted in the repo itself. Also, if these are ever gone it's no big deal to redo some captures.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's possible to do it like that:

![alt tag](https://raw.githubusercontent.com/mozilla-services/react-jsonschema-form/master/path/to/img.png)

@n1k0
Copy link
Collaborator Author

n1k0 commented Apr 24, 2016

I'm gonna land this with r=me.

@n1k0 n1k0 merged commit c668bfc into master Apr 24, 2016
@n1k0 n1k0 deleted the 150-native-date-time-widgets branch April 24, 2016 12:04
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.

3 participants