getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.32k stars 168 forks source link

[Panel] Range field does not show default value on load #1445

Closed fabianmichael closed 5 years ago

fabianmichael commented 5 years ago

Describe the bug When a range field is added to a blueprint, the slider element reflects its current value correctly, but the right-sided label only displays the value after the slider knob has been moved.

To Reproduce Steps to reproduce the behavior:

  1. Add a range slider to any existing blueprint. Here are the settings, that I used:
      perPage:
        label: Einträge pro Seite
        type: range
        step: 3
        min: 3
        max: 30
        default: 12
        required: true
        translate: false
  2. Open the corresponding page in the panel. The slider has a red border, saying that the field is invalid and the default value right-handed to the slider does not appear.

Expected behavior If a default value is set, the slider should behave like that number has been set automatically and not complain about an invalid field. I am aware, that this would mean that a permanent save bar will be displayed after a blueprint has changed, but I find it rather less intuitive if there is a default value, that requires user interaction for becoming saveable.

Screenshots bildschirmfoto 2019-02-04 um 13 00 50

Kirby Version 3.0.0

Console output

Desktop (please complete the following information):

fabianmichael commented 5 years ago

I used the range slider in another project and found some more related glitches:

bastianallgeier commented 5 years ago

musterknabe commented 1 year ago

I still have the same behavior in Kirby 3.8.3:

BackgroundGradientAngle:
  label: Angle
  type: range
  default: 90
  step: 1
  min: 0
  max: 359
  tooltip:
    after: degree
Screenshot 2022-12-14 at 13 29 47
distantnative commented 1 year ago

@musterknabe did you add the range field/its default in the blueprint after the page got created? Defaults are only applied during the creation of a page.

musterknabe commented 1 year ago

Yes I did. I was building my blueprint, while reloading the already created page.

When creating a new page, after the blueprint, the default gets applied to the tooltip, too.

But it's still strange, because the default value was applied to the slider itself correctly. Only the tooltip was missing it.