Skip to content

Rich Text 5.0.0: fullscreen button on second editor expands the first editor #2440

Description

@mrgold92

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

  1. Add two Rich Text widgets to the same page.
  2. Bind each widget to a different string attribute.
  3. Enable the fullscreen toolbar button in both widgets.
  4. Run the application.
  5. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions