Skip to content
Snippets Groups Projects
Commit 748e26b2 authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[dome/richtext] force default options

parent 9e6da8db
No related branches found
No related tags found
No related merge requests found
...@@ -330,13 +330,13 @@ class Option extends Extension { ...@@ -330,13 +330,13 @@ class Option extends Extension {
private readonly spec: CS.Extension; private readonly spec: CS.Extension;
private readonly comp = new CS.Compartment(); private readonly comp = new CS.Compartment();
constructor(extension: CS.Extension, active=true) { constructor(extension: CS.Extension) {
super(); super();
this.spec = extension; this.spec = extension;
this.pack(this.comp.of(active ? extension : [])); this.pack(this.comp.of([]));
} }
dispatch(view: View, active?: boolean): void { dispatch(view: View, active: boolean): void {
if (view !== null && active !== undefined) { if (view !== null && active !== undefined) {
const effects = this.comp.reconfigure(active ? this.spec : []); const effects = this.comp.reconfigure(active ? this.spec : []);
view.dispatch({ effects }); view.dispatch({ effects });
...@@ -868,8 +868,8 @@ export function TextView(props: TextViewProps) : JSX.Element { ...@@ -868,8 +868,8 @@ export function TextView(props: TextViewProps) : JSX.Element {
onViewport: onReview = null, onViewport: onReview = null,
onSelection: onSelect = null, onSelection: onSelect = null,
onDoubleClick: onDouble = null, onDoubleClick: onDouble = null,
lineNumbers: lines, lineNumbers: lines = false,
showCurrentLine: active, showCurrentLine: active = false,
} = props; } = props;
React.useEffect(() => OnClick.dispatch(view, onClick), [view, onClick]); React.useEffect(() => OnClick.dispatch(view, onClick), [view, onClick]);
React.useEffect(() => OnPopup.dispatch(view, onPopup), [view, onPopup]); React.useEffect(() => OnPopup.dispatch(view, onPopup), [view, onPopup]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment