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

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

Closed
fabianmichael opened this issue Feb 4, 2019 · 5 comments
Closed

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

fabianmichael opened this issue Feb 4, 2019 · 5 comments
Labels
type: bug 🐛 Is a bug; fixes a bug
Milestone

Comments

@fabianmichael
Copy link
Contributor

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
  1. 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):

  • OS: macOS 10.14.2
  • Browser: Firefox
  • Version: 65.0
@fabianmichael fabianmichael changed the title [Panel] Range field does show default value Panel: Range field does not show default value on load Feb 4, 2019
@distantnative distantnative changed the title Panel: Range field does not show default value on load [Panel] Range field does not show default value on load Feb 4, 2019
@distantnative distantnative added the type: bug 🐛 Is a bug; fixes a bug label Feb 4, 2019
@fabianmichael
Copy link
Contributor Author

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

  • If used inside of a structure field, default values work correctly, as long as the default parameter is not 0.
  • If the default value is 0, the range field will display a dash - as value when used outside of a structure field. When used inside a structure field, the default value is not set and the right-sided label displays NaN.

@bastianallgeier bastianallgeier added this to the 3.0.3 milestone Feb 18, 2019
@bastianallgeier bastianallgeier modified the milestones: 3.0.3, 3.1.0 Feb 25, 2019
@bastianallgeier bastianallgeier modified the milestones: 3.1.0, 3.1.1 Mar 12, 2019
@bastianallgeier bastianallgeier modified the milestones: 3.1.2, 3.1.3 Apr 1, 2019
@bastianallgeier bastianallgeier modified the milestones: 3.1.3, 3.2.0 Apr 12, 2019
@distantnative distantnative modified the milestones: 3.2.0, 3.1.4 May 3, 2019
@distantnative distantnative modified the milestones: 3.1.4, 3.2.1 May 10, 2019
@bastianallgeier bastianallgeier modified the milestones: 3.2.1, 3.2.2 Jul 2, 2019
@bastianallgeier bastianallgeier modified the milestones: 3.2.2, 3.2.3 Jul 10, 2019
@bastianallgeier bastianallgeier modified the milestones: 3.2.3, 3.2.4 Jul 30, 2019
@bastianallgeier bastianallgeier removed this from the 3.2.4 milestone Aug 22, 2019
@bastianallgeier
Copy link
Member

@bastianallgeier bastianallgeier added this to the 3.2.5 milestone Sep 10, 2019
@musterknabe
Copy link

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
Copy link
Member

@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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

No branches or pull requests

4 participants