Skip to content

feat: add locator to saveEditedXBlockData to fix xblock refresh#5

Merged
MaferMazu merged 1 commit intoednx-release/teak.ceibalfrom
bc/fix-xblock-refresh
Feb 18, 2026
Merged

feat: add locator to saveEditedXBlockData to fix xblock refresh#5
MaferMazu merged 1 commit intoednx-release/teak.ceibalfrom
bc/fix-xblock-refresh

Conversation

@bra-i-am
Copy link

@bra-i-am bra-i-am commented Feb 16, 2026

Description

This PR allows sending the locator to the handleSaveEditedXBlockData so an XBlock can send the signal to refresh the UI like this:

window.parent.postMessage(
    {
        type: 'saveEditedXBlockData',
        payload: { locator: usageId },
    },
    '*',
);

Why we needed this
We needed this to refresh the XBlock iframe when saving information in the XBlock fields.

Current behavior
When we edit an XBlock field with the pencil option and click save, we trigger handleSaveEditedXBlockData because it is the default behavior and has a configureXBlockId. But when we trigger it programmatically with xblock-exam-questionbank to save the collection info, the system doesn't pass the configureXBlockId.

What change
We are enabling the locator to be passed, so handleSaveEditedXBlockData refreshes the iframe.

Note
We know it is not ideal to edit the core, and we don't have this change in our map for now to send to upstream, but it was the only way we found to refresh the XBlock iframe.

PRs related:

@bra-i-am bra-i-am force-pushed the bc/fix-xblock-refresh branch from 5ad4bcb to 5842e5a Compare February 17, 2026 14:27
Copy link

@MaferMazu MaferMazu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bra-i-am, thanks for this PR, it worked as expected.


For context:

Why we needed this
We needed this to refresh the XBlock iframe when saving information in the XBlock fields.

Current behavior
When we edit an XBlock field with the pencil option and click save, we trigger handleSaveEditedXBlockData because it is the default behavior and has a configureXBlockId. But when we trigger it programmatically with xblock-exam-questionbank to save the collection info, the system doesn't pass the configureXBlockId.

What change
We are enabling the locator to be passed, so handleSaveEditedXBlockData refreshes the iframe.

Note
We know it is not ideal to edit the core, and we don't have this change in our map for now to send to upstream, but it was the only way we found to refresh the XBlock iframe.

PRs related:

@MaferMazu MaferMazu merged commit d0f965b into ednx-release/teak.ceibal Feb 18, 2026
3 of 4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants