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

Widget with array with nested areas - After after opening widget edit modal, parent array breadcrumb click no longer opens far right breadcrumb and edit options #4738

Open
Darren-Caboz-Altstudios opened this issue Oct 1, 2024 · 0 comments
Labels

Comments

@Darren-Caboz-Altstudios
Copy link

To Reproduce

Step by step instructions to reproduce the behavior:

  1. Please find video example for issue experienced - https://www.loom.com/share/034d41f2a3094aecb9b390bc371125b5?sid=202dddaf-7207-4f2b-bf3c-049db60202ac

Expected behavior

When editing a widget on the frontend for array with areas, the parent level breadcrumb option should still show up the far right breadcrumb and edit tools option when clicked. I do set the widget area margin spacing for top and bottom to zero, as I like the editing page to be as close as possible to the live frontend view:

[data-apos-area] [data-apos-area] {
margin: 0 !important;
}

Describe the bug

After you click the edit widget option for the widget, the parent is no shown on the page when you click the breadcrumb label.

Details

Version of Node.js:
Apostrophecms V4.7.1, clean install of apostrophecms

Server Operating System:
Mac OSX

Additional context:
Array schema:

// modules/two-column-widget/index.js
module.exports = {
  extend: '@apostrophecms/widget-type',
  options: {
    label: 'Two column',
  },
  // 👇 The widget type's field schema
  fields: {
    add: {
      columns: {
        type: 'array',
        label: 'Columns Array',
        fields: {
          add: {
            // 👇 The first column area
            columnOne: {
              type: 'area',
              label: 'Column One',
              options: {
                widgets: {
                  '@apostrophecms/rich-text': {},
                  '@apostrophecms/image': {},
                },
              },
            },
            // 👇 The second column area
            columnTwo: {
              type: 'area',
              label: 'Column Two',
              options: {
                widgets: {
                  '@apostrophecms/rich-text': {},
                  '@apostrophecms/image': {},
                },
              },
            },
          },
        },
      },
    },
  },
};

HTML:

<section class="columns">
  {% for col in data.widget.columns %}
    <div class="two-col">
      <div class="two-col__column">
        {% area col, 'columnOne' %}
      </div>
      {# <div class="two-col__column">
                    {% area col, 'columnTwo' %}
                  </div> #}
    </div>
  {% endfor %}
</section>
<style>
  /* modules/two-column-widget/ui/src/index.scss */
  .columns {
    background: #eee;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #000;
  }
  .two-col {
    display: flex;
    flex-flow: row wrap;
    width: 100%;
  }
  .two-col__column {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  [data-apos-area] [data-apos-area] {
    margin: 0 !important;
  }
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant