-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Issue behavior
See - 79c7b17#r150398933
In the useAnnotationSelectAction
hook, when the onUserSelect
is called - it doesn't receive the adapter
associated with the annotator instance.
However, the UserSelectActionExpression<E>
type dictates that the selection action callback will run on the external type annotation instance.
annotorious/packages/annotorious-react/src/Annotorious.tsx
Lines 164 to 167 in 94624c0
export const useAnnotationSelectAction = <I extends Annotation = ImageAnnotation, E extends unknown = ImageAnnotation>(id: string, action: UserSelectActionExpression<E>) => { | |
const annotation = useAnnotation<I>(id); | |
return annotation ? onUserSelect<I, E>(annotation, action) : undefined; | |
} |
That makes the user create the userSelectAction
callback that will throw the runtime exception while trying to run the useAnnotationSelectAction
.
Screenshots
However, in runtime, the userSelectAction
will receive an internal type instance:
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working