-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Add a range field and support steps in text fields #521
Conversation
I've added the |
b2174a9
to
8728020
Compare
I have updated the PR using |
No, Contao 4.8 is feature complete, so you can leave the branch as it is. |
Oh that's too bad. I only made the changes just now, because the depending change for 4.8 was made just now: #437 (comment) |
@fritzmg This PR needs to be rebased onto the current master branch so we can review it. 🙈 |
fc6e6dd
to
ae2b10d
Compare
Rebased and ready to review. |
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.
One minor detail, LGTM otherwise 👍
Contao 4.9 is now in the review phase in which we try to review and merge the remaining pull requests that have been created during the development phase. Your pull request does not yet meet the requirements to be reviewed though.
Please fix this soon if you can, because the review phase ends on January 15th and we need some time to review the PR before we can merge it. |
👍 I didn't know about the |
I think it could be any other element and the question is do we want a oninput -handler there. |
That's just Javascript. It's not native browser behaviour so I don't think we should support it. We might want to add support for the data-list once it's unified across all browsers though. |
But then not seeing what you slide-to gets even worse 🤪 |
I am with @Toflar here. |
Still not sure if this is the right way to go. A new input validation would have the exact same settings as the Also setting the form type to "Text field" in order to get an |
I agree, it should be its own widget (might extend or share logic though). Especially if the data-list options become standardized it will be interesting. |
I made a few more changes: It is perfectly valid to create form fields like this: <input type="number" min="0.5" max="1.5" step="0.1" value="0.2">
<input type="range" min="0.5" max="1.5" step="0.1" value="0.2"> Thus I have changed the HTML output like this <input type="range" value=""> is invalid, as the content of the |
The same is true for |
But there is a clear difference between
and
The former input types all have a text field, where you click and then can enter values manually. The latter is handled completely differently from the others. Sure, some of the input types in the former list have additional client side validation and some added fluff (like spinners, datepickers, etc.). But their concept is similar to one another - while the range slider is a completely different UI concept. (Sorry for the notification spam, my browser had some issues.) |
Ok, that's a good point. 👍 |
Thank you @fritzmg. |
This PR adds a
range
input field to the form generator.It also allows the
step
value to be set fornumber
input fields.I still used the old method of re-using the
minlength
andmaxlength
fields - so it still needs to be adjusted when #437 gets implemented.