-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Moodle Version in use
- Moodle 4.4.9
- Moodle 4.5.6
** Plugin Version **
v1.5.8 (2025032500)
Describe the bug
Similar to #156...and yet more.
When using a smartphone in a PDF annotator, and you are in rectangle mode and select a rectangle in the PDF, a console error appears. When you then select the "select mode" (hand), another console error appears. If you then select the rectangle in select mode, a third error appears. And when you click on the X to delete the rectangle, a final one appears.
In addition to that, sometimes the text editor for the comment appears and sometimes it doesn't. We can't yet discern when.
The errors:
(1) After creating a rectangle and then lifting the finger:
Uncaught TypeError: Cannot set properties of null (setting 'placeholder')
at openComment (index.js?ver=00039:6830:38)
at HTMLDocument.handleDocumentTouchend (index.js?ver=00039:6161:70)
(2) After selecting "select mode" after that:
Uncaught TypeError: Cannot set properties of null (setting 'value')
at closeComment (index.js?ver=00039:6774:74)
at HTMLDivElement.handleToolbarClick (index.js?ver=00039:6181:45)
(3) Selecting the empty rectangle when in select mode:
POST BASEURL/mod/pdfannotator/action.php 404 (Not Found)
send @ jquery-3.7.1.min.js:2
ajax @ jquery-3.7.1.min.js:2
getComments @ index.js?ver=00039:471
(anonymous) @ index.js?ver=00039:1891
handleAnnotationClick @ index.js?ver=00039:1983
EventEmitter.emit @ index.js?ver=00039:4009
handleDocumentClickFunction @ index.js?ver=00039:3898
handleDocumentClick @ index.js?ver=00039:3950
(4) After tapping on the X of the rectangle (page is not reloaded, instead JS notifications appear):
Notification: Deletion not allowedfalse
Notification: An error has occurred while getting the comments
To Reproduce
Steps to reproduce the behavior:
- Create a pdfannotator, settings don't matter
- Using a smartphone, open the pdfannotator
- Activate pin mode
- Touch a spot on the PDF to add a pin.
- Error (1) appears when you "touch up" (lift the finger)
- Select "select mode"
- Error (2) appears right after you changed the mode
- Select the rectangle by tapping it
- Error (3) appears after the rectangle is selected
Expected behavior
No console error should be shown, and the comment editor should always show.
Screenshots
None
Smartphone (please complete the following information):
- Device: Samsung Galaxy S21+
- OS: Android 15
- Browser: Android Chrome
- Version: 140.0.7339.51