When two Rich Text widgets are displayed on the same page, clicking the fullscreen button in the second widget expands the first widget instead.
Updating the widget from the Marketplace did not resolve the issue. The installed package declares version 5.0.0.
Steps to reproduce
- Add two Rich Text widgets to the same page.
- Bind each widget to a different string attribute.
- Enable the fullscreen toolbar button in both widgets.
- Run the application.
- Click the fullscreen button in the second editor.
Expected behavior
The second editor enters fullscreen.
Actual behavior
The first editor enters fullscreen instead.
Code investigation
In the installed widget bundle, the fullscreen extension uses document.querySelector(this.options.widgetSelector).
The configured selector is .widget-rich-text, so this returns the first matching widget on the page, regardless of which editor triggered the command.
The same document-wide lookup appears in:
toggleFullscreen
enterFullscreen
exitFullscreen
- The Escape shortcut
The fullscreen toolbar button's isActive callback also queries the first .widget-rich-text element.
Suggested fix
Scope fullscreen commands and the toolbar's active-state check to the current editor's widget container, rather than querying the entire document.
Please include a regression test with two editors on the same page, verifying that each editor can enter and exit fullscreen independently.
When two Rich Text widgets are displayed on the same page, clicking the fullscreen button in the second widget expands the first widget instead.
Updating the widget from the Marketplace did not resolve the issue. The installed package declares version 5.0.0.
Steps to reproduce
Expected behavior
The second editor enters fullscreen.
Actual behavior
The first editor enters fullscreen instead.
Code investigation
In the installed widget bundle, the fullscreen extension uses
document.querySelector(this.options.widgetSelector).The configured selector is
.widget-rich-text, so this returns the first matching widget on the page, regardless of which editor triggered the command.The same document-wide lookup appears in:
toggleFullscreenenterFullscreenexitFullscreenThe fullscreen toolbar button's
isActivecallback also queries the first.widget-rich-textelement.Suggested fix
Scope fullscreen commands and the toolbar's active-state check to the current editor's widget container, rather than querying the entire document.
Please include a regression test with two editors on the same page, verifying that each editor can enter and exit fullscreen independently.