1
+ /**
2
+ * I just found a problem with RIPS regarding clients being deleted
3
+ * without warning. If you ever update a client's basic information
4
+ * (on the Client Basic Information page), please make sure you save
5
+ * the client by clicking the "Save" button in the top-left corner
6
+ * of the page. DO NOT PRESS [ENTER] ON THE PAGE!! It seems that by
7
+ * pressing enter, it's possible to see a popup that looks like this:
8
+ *
9
+ * [image]
10
+ *
11
+ * If you click "Ok", YOU WILL DELETE THE CLIENT!!! If you ever see
12
+ * this popup, click "Cancel" or press the [Esc] key on your keyboard.
13
+ *
14
+ * If you accidentally press "Ok" or if you have done this in the
15
+ * past, please send me the client details you were working on, as
16
+ * your client was probably deleted.
17
+ *
18
+ * I am already sending this bug report to the developers, so I will
19
+ * send an "all clear" once this has been fixed. Until then, PLEASE
20
+ * DO NOT PRESS THE [ENTER] KEY ON THE CLIENT BASIC INFORMATION PAGE!!!
21
+ *
22
+ * Thank you very much, please let me know if there are any questions.
23
+ */
24
+ console . log (
25
+ '[DeleteSubmitSkip]: Note - remove code once devs fix bug!'
26
+ ) ;
27
+
28
+ // on keydown, handle key code
29
+ document . addEventListener ( "keydown" , function ( e ) {
30
+ //
31
+ switch ( e . key ) {
32
+ case 'Enter' :
33
+ console . log ( '[DeleteSubmitSkip]: pressed [Enter]' +
34
+ ' - prevent default' , e ) ;
35
+ // temporarily fix bug by not allowing 'enter' to trigger
36
+ // form submit
37
+ e . preventDefault ( ) ;
38
+ break ;
39
+
40
+ default :
41
+ // don't care about anything else
42
+ break ;
43
+ }
44
+ } ) ;
0 commit comments