-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Low
-
Component/s: Macros - Other - 3rd Party
-
Severity 3 - Minor
Issue Summary
When a Forge macro uses a custom configuration panel, submitting the configuration via view.submit() or closing the dialog via view.close() causes the Confluence page to scroll unconditionally back to the top (Y=0). The behavior is not limited to bridge API calls — opening or closing layered UI components (from @forge/react) inside the macro iframe triggers the same scroll-to-top, even when view.submit() and view.close() are not used and configuration is saved via invoke() to the backend KVS. The issue affects all instances and only occurs in edit mode, not on published pages.
Steps to Reproduce
- Create a Forge macro with a custom configuration resource (pencil-icon config panel), following the official tutorial at https://developer.atlassian.com/platform/forge/add-custom-configuration-to-a-macro/
- Place the macro at the bottom of a Confluence page long enough to require vertical scrolling.
- Scroll down to the macro.
- Click the pencil icon to open the configuration panel.
- Make a change in any field and click Save (view.submit() is called).
- Observe: the page scrolls back to the top.
Expected Results
After submitting the configuration or interacting with layered UI components inside the macro, the viewport should maintain its current scroll position, keeping the user focused on the macro they are currently editing.
Actual Results
- The page viewport aggressively scrolls to the top of the document regardless of scroll position, macro content, or whether configuration was saved via bridge API or backend invoke(). The root cause appears to be that iframe-resizer fires resize events too aggressively, and the Confluence editor wrapper DOM does not properly preserve scroll position around those events.
- Notable debug observation: the scroll-to-top does NOT happen if a full-width element (e.g. a table, native Confluence /expand macro, or certain third-party macros) is placed at the very first line of the Confluence page. This points to a DOM reflow or ResizeObserver anomaly in the Confluence editor iframe wrapper.
Related issues: CONFCLOUD-71460, CONFCLOUD-84000, RFC: Upgrading the iframe-resizer.
Workaround
A workaround was attempted by injecting a visually invisible but layout-present full-width element at y=0 inside the macro's rendered output:
// In your macro's UI Kit frontend (src/index.jsx or equivalent) import { Box } from '@forge/react'; // Render this as the first child of your macro output <Box xcss={{ width: '100%', height: '1px', overflow: 'hidden' }} />
This workaround did not resolve the issue. Testing with a Minimal Reproducible Example confirmed the bug persists even with the Box element in place.
There is currently no known complete workaround for this behavior. A workaround will be added here when available.
- relates to
-
CONFCLOUD-84608 Restore scroll position when using the browser Back button in Confluence Cloud
- Gathering Interest
- mentioned in
-
Page Loading...