Skip to content

Commit 497646b

Browse files
Fix annotationMenu not being correctly set (#664)
* Fix annotationMenu not being correctly set * Updating package version --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent be84f05 commit 497646b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

android/src/main/java/com/pdftron/reactnative/views/DocumentView.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
import com.pdftron.pdf.model.AnnotStyle;
7272
import com.pdftron.pdf.model.UserBookmarkItem;
7373
import com.pdftron.pdf.tools.AdvancedShapeCreate;
74+
import com.pdftron.pdf.tools.AnnotEditTextMarkup;
7475
import com.pdftron.pdf.tools.AnnotManager;
7576
import com.pdftron.pdf.tools.Eraser;
7677
import com.pdftron.pdf.tools.FreehandCreate;
@@ -2501,7 +2502,8 @@ public boolean onShowQuickMenu(QuickMenu quickMenu, Annot annot) {
25012502

25022503
// remove unwanted items
25032504
ToolManager.Tool currentTool = getToolManager() != null ? getToolManager().getTool() : null;
2504-
if (mAnnotMenuItems != null && !(currentTool instanceof Pan) && !(currentTool instanceof TextSelect)) {
2505+
boolean isPanOrTextSelect = (currentTool instanceof Pan || (currentTool instanceof TextSelect && !(currentTool instanceof AnnotEditTextMarkup)));
2506+
if (mAnnotMenuItems != null && !isPanOrTextSelect) {
25052507
List<QuickMenuItem> removeList = new ArrayList<>();
25062508
checkQuickMenu(quickMenu.getFirstRowMenuItems(), mAnnotMenuItems, removeList);
25072509
checkQuickMenu(quickMenu.getSecondRowMenuItems(), mAnnotMenuItems, removeList);
@@ -2512,7 +2514,7 @@ public boolean onShowQuickMenu(QuickMenu quickMenu, Annot annot) {
25122514
quickMenu.setDividerVisibility(View.GONE);
25132515
}
25142516
}
2515-
if (mLongPressMenuItems != null && (currentTool instanceof Pan || currentTool instanceof TextSelect)) {
2517+
if (mLongPressMenuItems != null && isPanOrTextSelect) {
25162518
List<QuickMenuItem> removeList = new ArrayList<>();
25172519
checkQuickMenu(quickMenu.getFirstRowMenuItems(), mLongPressMenuItems, removeList);
25182520
checkQuickMenu(quickMenu.getSecondRowMenuItems(), mLongPressMenuItems, removeList);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-pdftron",
33
"title": "React Native Pdftron",
4-
"version": "3.0.3-23",
4+
"version": "3.0.3-24",
55
"description": "React Native Pdftron",
66
"main": "./lib/index.js",
77
"typings": "index.ts",

0 commit comments

Comments
 (0)