Likert elements pre-selects default values even if not asked for this.
I was struggling to find particular case, but finally nailed it down to example bellow.
epic_question:
'#type': likert
'#title': 'Your state recently?'
'#questions':
EPIC1: 'How was your mood last week ?'
EPIC2: 'How are you feeling today ?'
'#answers':
100: 'No problem'
50: 'Lite problem'
0: 'Big problem'
With this yaml, form opens with last answer selected by default
NOW.. if you change value from 0 to 1, it works as expected. No default selection in form.
Comments
Comment #2
gpikelis commentedComment #3
jrockowitz commentedI agree that this is a major issue.
The attached webform replicates the issue and the attached patch is a rough attempt at a solution. I want to see if it breaks any tests.
The handling of '0', empty strings, NULL, and N/A within a likert element is definitely going to require some additional test coverage.
Comment #4
gpikelis commentedI will do some more testing, but funny thing is that same form runs fine on older version of Drupal and WebForms I have on one of the machines.
Drupal core 8.3.7
Webform 8.x-5.0-beta4
Comment #5
gpikelis commentedLooks ok now.
Comment #6
jrockowitz commentedComment #8
jrockowitz commented