diff --git a/services/web/frontend/js/features/source-editor/components/codemirror-search-form.tsx b/services/web/frontend/js/features/source-editor/components/codemirror-search-form.tsx index 270949c023..f04299fbb0 100644 --- a/services/web/frontend/js/features/source-editor/components/codemirror-search-form.tsx +++ b/services/web/frontend/js/features/source-editor/components/codemirror-search-form.tsx @@ -214,6 +214,8 @@ const CodeMirrorSearchForm: FC = () => { return getSearchQuery(state) }, [state]) + const showReplace = !state.readOnly + return ( // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
{ - - - + className="ol-cm-search-input-group ol-cm-search-replace-input" + > + + + )}
{ )}
-
- + {showReplace && ( +
+ - -
+ +
+ )}
diff --git a/services/web/frontend/js/features/source-editor/components/codemirror-toolbar.tsx b/services/web/frontend/js/features/source-editor/components/codemirror-toolbar.tsx index cac609ff86..6fcafa912f 100644 --- a/services/web/frontend/js/features/source-editor/components/codemirror-toolbar.tsx +++ b/services/web/frontend/js/features/source-editor/components/codemirror-toolbar.tsx @@ -113,10 +113,12 @@ const Toolbar = memo(function Toolbar() { return null } + const showActions = !state.readOnly && !insideTable + return (
{showSourceToolbar && } - {!insideTable && ( + {showActions && ( )}
- {!insideTable && ( + {showActions && ( () const toolbarState = StateField.define({ create: () => true, update: (value, tr) => { - if (tr.state.readOnly) { - return false - } for (const effect of tr.effects) { if (effect.is(toggleToolbarEffect)) { value = effect.value