You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Open a document using /editor?src=<document-url>&readonly=1, or pass readonly: true through the iframe API.
Observe the editing toolbar.
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.
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:
feat(readonly): keep only File and View tabs in read-only mode #300: instead of greying out the toolbar, read-only keeps only the File and View tabs and opens on View. Editing buttons that sit outside those tabs (paste, cut, format painter, macros, freeze panes, slide master, Edit PDF, the edit-mode switch) are hidden.
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:
Same document after switching read-only off:
Spreadsheet and PDF, read-only:
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!
Activity
fix(readonly): lock the editor chrome along with the restriction
chaxus commentedon Nov 2, 2026
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-readonlywithreadonly: false) brings the full toolbar back and returns to the tab you were on.Word, read-only:
Same document after switching read-only off:
Spreadsheet and PDF, read-only:
This works the same way for
/editor?src=...&readonly=1and forreadonly: truethrough 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!