[MGNLFE-100] Render green bars not called after ONLY editable area / component updated Created: 08/Jul/21  Updated: 19/Aug/21  Resolved: 14/Jul/21

Status: Closed
Project: Magnolia Frontend Helpers
Component/s: None
Affects Version/s: 1.0.6
Fix Version/s: 1.1.0

Type: Bug Priority: Neutral
Reporter: Bartosz Staryga Assignee: Bartosz Staryga
Resolution: Fixed Votes: 0
Labels: VN-Testing, headless-team-support
Remaining Estimate: Not Specified
Time Spent: 1d 3h
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[X]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Epic Link: SPA Editor Backlog
Sprint: HL & LD 33
Story Points: 2

 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


Generated at Mon Feb 12 05:44:14 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.