I’m building a Confluence macro with a custom config panel using Forge Custom UI. The config panel has two buttons that submit different body content using view.submit().
-
First button click: Body updates correctly in the macro -
Second button click: view.submit() is called with correct body and config, but the macro doesn’t update the body
Macro rendered : (button 1 clicked then button 2)
![]()
const handleTestSubmit = async (buttonText, buttonNumber) => {
try {
const ctx = await view.getContext();
const testBody = doc(
paragraph(
placeholder({
text: buttonText,
})
)
);
const testConfig = { testButtonClicked: buttonNumber };
console.log('Test: Submitting body:', JSON.stringify(testBody, null, 2));
console.log('Test: Submitting config:', JSON.stringify(testConfig, null, 2));
await view.submit({
config: testConfig,
body: testBody
});
console.log('Test: Submit completed successfully');
setMessage(`✓ Button ${buttonNumber} submitted successfully!`);
} catch (err) {
console.error(‘Test submit error:’, err);
setMessage(✗ Error: ${err.message});
}
};
// Two buttons:
<Button onClick={() => handleTestSubmit(‘This is button 1’, 1)}>Button 1
<Button onClick={() => handleTestSubmit(‘This is button 2’, 2)}>Button 2
Observations:
-
Both button clicks successfully log the correct body and config to the browser console
-
The config panel closes after each submit (expected behavior)
-
The body is properly constructed using ADF builders (doc(), paragraph(), placeholder())
-
No error codes are thrown (INVALID_EXTENSION_TYPE, INVALID_BODY, etc.)
Environment:
-
Forge Confluence Macro
-
React 18.3.1
-
@atlaskit/adf-utils/builders for ADF generation
Any guidance would be appreciated! ![]()
