Uploaded image for project: 'Magnolia Frontend Helpers'
  1. Magnolia Frontend Helpers
  2. MGNLFE-100

Render green bars not called after ONLY editable area / component updated

    XMLWordPrintable

Details

    Description

      Steps to reproduce

      Consider following code:

      function Home(props) {
        const [showArea, setShowArea] = useState(false);
        const { title, main, metadata } = props;
      
        setTimeout(() => setShowArea(true), 5000);
      
        return (
          <div>
            <h1>{title}</h1>
            {showArea && <EditableArea content={main} parentTemplateId={metadata['mgnl:template']} />}
          </div>
        );
      }
      

      When an editable area is added the update is not bubbled up to the parent editable page and the refresh method is not called.

      Expected results

      Gree bars are added to the area.

      Actual results

      No green bars added to the area.

      Workaround

      useEffect(() => {
        EditorContextHelper.refresh();
      }, [showArea]);
      

      Development notes

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              bstaryga Bartosz Staryga
              bstaryga Bartosz Staryga
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD

                  Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 1d 3h
                    1d 3h