Skip to content

Commit

Permalink
Merge branch 'refs/heads/recogito#127-annotating-enabled-reactive' in…
Browse files Browse the repository at this point in the history
…to staging
  • Loading branch information
oleksandr-danylchenko committed Nov 11, 2024
2 parents b627479 + 4249cc1 commit ef576a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/text-annotator/src/SelectionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const createSelectionHandler = (

let lastDownEvent: Selection['event'] | undefined;

let currentAnnotatingEnabled = true;
let currentAnnotatingEnabled = annotatingEnabled;

const setAnnotatingEnabled = (enabled: boolean) => {
currentAnnotatingEnabled = enabled;
Expand Down
14 changes: 5 additions & 9 deletions packages/text-annotator/src/TextAnnotatorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ export type RendererType = 'SPANS' | 'CANVAS' | 'CSS_HIGHLIGHTS';
export const fillDefaults = <I extends TextAnnotation = TextAnnotation, E extends unknown = TextAnnotation>(
opts: TextAnnotatorOptions<I, E>,
defaults: TextAnnotatorOptions<I, E>
): TextAnnotatorOptions<I, E> => {

return {
...opts,
annotatingEnabled: opts.annotatingEnabled ?? defaults.annotatingEnabled,
user: opts.user || defaults.user
};

};
): TextAnnotatorOptions<I, E> => ({
...opts,
annotatingEnabled: opts.annotatingEnabled ?? defaults.annotatingEnabled,
user: opts.user || defaults.user
});

0 comments on commit ef576a2

Please sign in to comment.