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

mediapicker field is not displayed as it should anymore #2342

Open
DrDroid-FR opened this issue Feb 21, 2023 · 4 comments
Open

mediapicker field is not displayed as it should anymore #2342

DrDroid-FR opened this issue Feb 21, 2023 · 4 comments
Assignees

Comments

@DrDroid-FR
Copy link

I worked on a GRAV 1.7.26 (PHP 7.4.8) website with custom admin tab including a mediapicker field. The mediapicker displayed well.
Since I updated GRAV to 1.7.39.X with all plugins, the mediapicker is not displayed as it should anymore.
The scrollbars are not included (the modal scrolls) and the lists (tree and media) are displayed after the container.

I tried to install a fresh GRAV site and test the mediapicker field in the admin and I have the same result :
Enregistrement 2023-02-20 221529.webm

I tried to exclude the admin from the flex objets directory but it only let me see the folder's tree.

I saw that the code changed a lot between those two versions, particularly with the scrollbars and the way the medipicker is displayed in the modal but I can't correct it myself.

@rhukster
Copy link
Member

Can you please provide a copy of your custom blueprint that contains that mediapicker field?

@rhukster rhukster self-assigned this Feb 21, 2023
@DrDroid-FR
Copy link
Author

DrDroid-FR commented Feb 21, 2023

For the exemple in the video I simply added the code to the default YAML (edit: on a fresh GRAV + Admin)

extends@: default

form:
    fields:
        tabs:
          fields:
            advanced:
              fields:
                columns:
                  fields:
                    column1:
                       fields:
                         header.body_classes:
                           markdown: true
                           description: 'Available classes in Quark Theme (space separated):<br />`header-fixed`, `header-animated`, `header-dark`, `header-transparent`, `sticky-footer`'
                         header.file:
                            filesize: 5
                            type: mediapicker
                            destination: "self@"
                            label: Fichier
                            preview_images: true
                            accept:
                              - image/*   

@DrDroid-FR
Copy link
Author

DrDroid-FR commented Feb 21, 2023

In the production site it's nested in a tab (but I have the exact same behavior):

title: Article
"@extends":
  type: xyz
  context: blueprints://pages

form:
  fields:
    tabs:
      type: tabs
      fields:
        content:
          fields:
...
          type: tab
          fields:
            sections:
              type: fieldset
              collapsed: false
              collapsible: false
              fields:
...
                    .picture:
                      type: fieldset
                      title: Image
                      collapsed: false
                      collapsible: true
                      fields:
                        referer:
                          type: hidden
                          default: field-selection__picture
                        .file:
                          filesize: 5
                          type: mediapicker
                          destination: "self@"
                          label: Fichier
                          preview_images: true
                          accept:
                            - image/*

DrDroid-FR added a commit to DrDroid-FR/grav-plugin-admin that referenced this issue Feb 23, 2023
My workaround for issue#2342 : getgrav#2342
@DrDroid-FR
Copy link
Author

I corrected this issue by adding a simple overflow: scroll; to mediapicker-scroll in themes/grav/scss/template/_media.scss

    .mediapicker-scroll {
      position: absolute;
      top: 55px;
      bottom: 30px;
      height: inherit;
      overflow: scroll;
    }

See DrDroid-FR:patch-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants