Skip to content

Read-only mode leaves editing controls visually enabled #298

Open

Description

@waseeen

When opening a document in read-only mode, editing controls remain visible and appear enabled, although they do not modify the document. This makes it difficult to tell which actions are available and gives the impression that the editor is malfunctioning.

Steps to reproduce

  1. Open a document using /editor?src=<document-url>&readonly=1, or pass readonly: true through the iframe API.
  2. Observe the editing toolbar.
  3. Click an editing control: it appears available but has no effect.

Expected behavior

Read-only mode should clearly communicate that the document is being viewed:

  • Hide editing controls or visibly disable them.
  • Keep applicable viewing tools available, such as navigation, search and zoom.

Implementation context

In lib/onlyoffice-editor.ts, the editor is initialized with permissions.edit: true and editorConfig.mode: 'edit'. Read-only restrictions are then applied through asc_setRestriction(VIEW).

The comments in lib/onlyoffice/readonly.ts explain that this allows switching between read-only and editable modes without rebuilding the editor. However, the toolbar does not visually reflect the restriction.

Could read-only mode also update the interface accordingly? Using the native viewer mode when opening a read-only document, or consistently disabling editing controls while retaining runtime switching, would both address the issue.

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