Skip to content

Read-only mode leaves editing controls visually enabled #298

Closed

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

  1. chaxus commented on Nov 2, 2026

    @chaxus
    Member

    Thanks a lot for the clear report and the pointers into readonly.ts! You were right: read-only only blocked edits inside the SDK and never told the UI, so the toolbar kept looking live. 🙏

    We kept runtime switching, since it's what lets the iframe API toggle read-only without reloading the document. The interface now follows the read-only state. The fix landed in two steps:

    Viewing tools stay available: search, zoom, fit to page/width, navigation, rulers, copy, and the status bar. Turning read-only off (document:set-readonly with readonly: false) brings the full toolbar back and returns to the tab you were on.

    Word, read-only:

    Read-only document

    Same document after switching read-only off:

    Editable document

    Spreadsheet and PDF, read-only:

    Read-only spreadsheet

    Read-only PDF

    This works the same way for /editor?src=...&readonly=1 and for readonly: true through the iframe API, in documents, spreadsheets, presentations and PDFs. #300 is going through CI now and will be on https://edit.chaxus.com/ shortly after it merges. If anything still looks editable when it shouldn't, or a viewing tool you rely on went missing, please let us know. Thanks again!

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