Skip to content

Commit

Permalink
Open note annotation popup after creation
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeJellinek committed Nov 21, 2024
1 parent c5a9067 commit daf1325
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/dom/common/components/overlay/annotation-overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,7 @@ let CommentIcon = React.forwardRef<SVGSVGElement, CommentIconProps>((props, ref)
width={size}
height={size}
viewBox="0 0 24 24"
data-annotation-id={props.annotation?.id}
ref={ref}
>
<IconNoteLarge/>
Expand Down
6 changes: 5 additions & 1 deletion src/dom/common/dom-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,10 @@ abstract class DOMView<State extends DOMViewState, Data> {
ifNeeded: true,
});
this._iframeWindow.getSelection()?.removeAllRanges();
if (type === 'note') {
this._renderAnnotations(true);
this._openAnnotationPopup();
}
}
event.preventDefault();
return;
Expand Down Expand Up @@ -1644,7 +1648,7 @@ export type DOMViewOptions<State extends DOMViewState, Data> = {
onChangeViewState: (state: State, primary?: boolean) => void;
onChangeViewStats: (stats: ViewStats) => void;
onSetDataTransferAnnotations: (dataTransfer: DataTransfer, annotation: NewAnnotation<WADMAnnotation> | NewAnnotation<WADMAnnotation>[], fromText?: boolean) => void;
onAddAnnotation: (annotation: NewAnnotation<WADMAnnotation>, select?: boolean) => void;
onAddAnnotation: (annotation: NewAnnotation<WADMAnnotation>, select?: boolean) => WADMAnnotation;
onUpdateAnnotations: (annotations: Annotation[]) => void;
onOpenLink: (url: string) => void;
onSelectAnnotations: (ids: string[], triggeringEvent?: KeyboardEvent | MouseEvent) => void;
Expand Down

0 comments on commit daf1325

Please sign in to comment.