readOnly top-level property

Facet<bool, bool> readOnly
final

This facet controls the value of the EditorState.readOnly getter.

Commands and extensions that implement editing functionality consult this to determine whether they should apply. It defaults to false, but when its highest-precedence value is true, such functionality disables itself.

Not to be confused with EditorView.editable, which controls whether the editor's DOM is set to be editable (and thus focusable).

Implementation

final Facet<bool, bool> readOnly = Facet.define(
  FacetConfig(combine: (values) => values.isNotEmpty ? values[0] : false),
);