Skip to content

Commit

Permalink
Reverting popup API change
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimon committed Sep 25, 2024
1 parent 78f3067 commit c3a5b26
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/extension-tei/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"ignoreDeprecations": "5.0",
"importsNotUsedAsValues": "error",
"incremental": false,
"isolatedModules": true,
"module": "ESNext",
Expand All @@ -14,7 +13,8 @@
"resolveJsonModule": true,
"skipLibCheck": false,
"sourceMap": true,
"target": "ESNext"
"target": "ESNext",
"verbatimModuleSyntax": true
},
"include": ["./src/**/*", "./test/**/*"],
"exclude": ["node_modules", "dist"]
Expand Down
1 change: 0 additions & 1 deletion packages/text-annotator-react/src/TextAnnotator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { createTextAnnotator } from '@recogito/text-annotator';

import '@recogito/text-annotator/dist/text-annotator.css';


export interface TextAnnotatorProps<E extends unknown> extends Omit<TextAnnotatorOptions<TextAnnotation, E>, 'adapter'> {

children?: ReactNode | JSX.Element;
Expand Down
11 changes: 3 additions & 8 deletions packages/text-annotator-react/src/TextAnnotatorPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import {

interface TextAnnotationPopupProps {

requirePointerEvent?: boolean;

popup(props: TextAnnotationPopupContentProps): ReactNode;

}
Expand Down Expand Up @@ -68,13 +66,10 @@ export const TextAnnotatorPopup = (props: TextAnnotationPopupProps) => {
const selectedKey = selected.map(a => a.annotation.id).join('-');

useEffect(() => {
if (props.requirePointerEvent && event) {
// Ignore all selection changes except those accompanied by a pointer event.
// Ignore all selection changes except those accompanied by a pointer event.
if (event)
setOpen(selected.length > 0 && event.type === 'pointerup');
} else {
setOpen(selected.length > 0);
}
}, [event?.type, selectedKey, props.requirePointerEvent]);
}, [event?.type, selectedKey]);

useEffect(() => {
if (!isOpen || !annotation) return;
Expand Down

0 comments on commit c3a5b26

Please sign in to comment.