Needs work
Project:
Drupal core
Version:
main
Component:
field system
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
4 Sep 2014 at 14:47 UTC
Updated:
21 Apr 2023 at 01:08 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #1
clemens.tolboom@Berdir suggests to make this a widget.
@xjm suggest to make this contrib.
Comment #3
larowlan+1 for widget
Comment #4
clemens.tolboomAttached patch makes it a widget which is indeed much better.
According to http://www.w3.org/TR/html5/forms.html#range-state-(type=range) we can add a datalist.
This only renders in Chrome but without labels.
Comment #5
clemens.tolboomComment #6
swentel commentedWicked !
One nitpick
I guess this should say something like 'range number' ?
Comment #7
clemens.tolboom@swentel I fixed for #6
What about the remaining tasks? Where to put the current value? Should we try to add the datalist?
Comment #8
swentel commented@clemens.tolboom Hmm, I'm no user interface specialist - we should get bojhan or yoroy here for some advice.
Comment #9
pepperstreet commentedJust found your blog post via G+, can't really help with coding because of very limited knowledge in Drupal.
But I recently came across this D7 module:
Slider Field (D7)
Maybe a good source (for inspiration)?
Regarding HTML5 range, here is an interesting article… see under "Show and Tell":
Playing With The HTML5 range Slider Input
Comment #10
clemens.tolboom@swentel I'll try to contact bojhan or yoroy
@pepperstreet thanks for the links ... we checked with jqueryui-slider on our D8 headless UI and did a 'Show and Tell'.
Puzzle is should we fix this in core? How much should we add? Or just let go and wait for a contrib?
My hunch is provide the widget in core (out of the box) with small jQuery UI support.
Comment #11
clemens.tolboomI'm trying to create a new twig for input range
input--range.html.twigfor the<output />field but it is never found by the theme system. Why?For the datalist we need same code as used by
modules/options/src/Plugin/Field/FieldType/ListItemBase.phpComment #12
clemens.tolboomHow/where do we add javascript for the widget?
Comment #13
clemens.tolboomComment #14
clemens.tolboomIn #2332885: Rename AllowedValuesInterface to OptionsProviderInterface a ref to #2329937: Allow definition objects to provide options leads to #2305397: OptionsProviderInterface sits on FieldItem, should on FieldDefinition (because often like in Views you have no item!) all related to get a
<datalist/. I hope.Comment #15
star-szrTo add a new template like that to a module you need to declare it in hook_theme() as input__range and specify the base hook. See comment_theme() and node_theme() for examples.
Comment #16
clemens.tolboomField is now themed 'correctly'. See remaining tasks. Please take over this issue :-)
Comment #17
clemens.tolboomAdded how to test
Added XREFs for the
<datalist />a it's code is similar as used by theoptions.moduleandcore/modules/options/src/Plugin/Field/FieldType/ListItemBase.phpComment #18
star-szrFixing runaway code tag in the issue summary. I'm not working on feature requests right now though.
Comment #21
Bojhan commentedNothing to review at this point.
Comment #28
xjmComment #29
xjmComment #30
clemens.tolboomComment #31
swatichouhan012 commentedRerolled patch#11 wrt 8.9.x
Comment #32
hash6 commentedComment #34
hardik_patel_12 commentedRe-roll for 9.1.x-dev
Comment #35
hardik_patel_12 commentedKindly ignore last patch , because patch at #34 and #31 are identical , i am triggering test for 9.1.x branch on #31. So patch at #34 is not needed sorry for that.
Comment #36
clemens.tolboomNot sure why but credit and commit did not have my name in it? I have seen in more issues that author changed from initial to others.
Guess I cannot fix this but this is my try :-)
Comment #37
clemens.tolboomThat did not work out as expected. Guess changing these `Credit and committing` is file attachment based?
Comment #38
jofitzRemoved "Needs reroll" tag.
Comment #44
joaopauloc.dev commentedPatch #31 was applied and works fine.
Steps followed.
1 - Create a number field in the page content type
2 - Change the field widget to the Range field on the manager form display
3 - Crate a new node of the content page and I could see the range field
4 - Edited the node created and changed the value to check if the got the correct value.
5 - Update the field number by adding min and max value options.
6 - Created another node and I could see the range respecting the min and max value.
See all attachments for evidence.
Hey @xjm, I updated this issue to reviewed and tested by the community status, after @bojhan comment on #21.
Should we keep this status or do we need to wait for another approval?
Thanks.
Comment #45
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #46
joaopauloc.dev commentedOn it, fixing the php cs and adding unit test to new widget created
Comment #48
joaopauloc.dev commentedComment #49
smustgrave commentedThis still needs a usability review but just from my observations
There is no way to tell the current value.
When I saved this page the view mode said the value was 66 but I had 0 idea.
Comment #50
camchandler98 commentedI thought adding a display for the slider would be just quickly editing the twig template but boy was I wrong. Long story short I ended up twig debugging and saw that the range input is still using the default input template
.
I think I know what to do now though so I will work on it.