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

Range inside a list shows no value in screen when adding a new page #2062

Closed
javiercoll opened this issue Feb 10, 2021 · 4 comments
Closed
Assignees

Comments

@javiercoll
Copy link

Grav version: 1.7.5
Admin Panel version: 1.10.3

How to reproduce:

  1. Add this blueprint:
title: Test

form:
  fields:
    tabs:
      type: tabs
      active: 1

      fields:
        test:
          type: tab
          title: Test

          fields:
            header.thisworks:
              name: thisworks
              type: range
              label: Range outside list
              default: 0
              validate:
                min: 0
                max: 10

            header.thisdoesnot:
              name: test
              type: list
              label: List

              fields:
                .range:
                  name: range
                  type: range
                  label: Range in list
                  default: 0
                  validate:
                    min: 0
                    max: 10
  1. Go to Admin > Pages > Add page, and add a page with the previous template
  2. In the 'List' list, click on 'Add item'
  3. In the 'Range in list' range, move the range.

Current behavior:
The range value does not change.

Expected behavior:
The range value changes according to the range.

Additional information:
Even though the range value is not updated in the UI, once you save it's populated correctly. Also, when you edit the page again, the range works as expected. It's just not working for new pages.

If you have a range outside of a list, the range works as expected.

@rhukster
Copy link
Member

My guess is that js got broken.

@rhukster rhukster added the bug label Feb 12, 2021
@w00fz
Copy link
Member

w00fz commented Mar 23, 2021

This was actually never compatible with lists. The only JS it has is an inline oninput which is definitely not great. I think this just was a bad PR we merged in years and years ago.

I'll rework this a bit better and make it compatible with lists.

@w00fz w00fz closed this as completed in c45e9bd Mar 23, 2021
@w00fz
Copy link
Member

w00fz commented Mar 23, 2021

This now works better.

w00fz-2021-03-22_@_18 00 12@2x

@mahagr mahagr added the fixed label Mar 23, 2021
@javiercoll
Copy link
Author

Looks good, thanks!

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

4 participants