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

[D9] Form API: Add a range widget option for number fields #4649

Open
klonos opened this issue Sep 26, 2020 · 4 comments
Open

[D9] Form API: Add a range widget option for number fields #4649

klonos opened this issue Sep 26, 2020 · 4 comments

Comments

@klonos
Copy link
Member

klonos commented Sep 26, 2020

This is similar to https://www.drupal.org/project/drupal/issues/2332833 and related to https://www.drupal.org/project/drupal/issues/2958499

Number inputs should allow the following widgets:

  • number: text field with up/down buttons
  • range: slider

image

We should allow the slider:

  • to be rendered vertically
  • to be "reversed"

This feature could be used:

Additional information

@indigoxela
Copy link
Member

@klonos why do you mention type="number" here? That's already in core for quite some time, only the documentation lags behind.

+1 from me for adding <input type="range"> to core. (Although I'm not sure if this type of input is the best solution for #4650)

@indigoxela
Copy link
Member

OK, that's funny... the input type range is in core for years.

https://github.com/backdrop/backdrop/blob/f4178d3babf538caba254281a6e82a460c3163e9/core/includes/form.inc#L4527

But nobody knows because it's not documented.

@docwilmot
Copy link
Contributor

OK, that's funny... the input type range is in core for years.

Really? I ported this for nothing? https://github.com/backdrop-contrib/range

@indigoxela
Copy link
Member

I ported this for nothing?

I don't think so. The contrib module provides field types for the Field module, constructed from two textfields. This issue here is about form API and the range input type (<input type="range">).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants