Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.10 RC1 Wrong Cursor Postioning while edititing Ticket Answer #2322

Closed
gmt-it opened this issue Jul 28, 2015 · 43 comments
Closed

1.10 RC1 Wrong Cursor Postioning while edititing Ticket Answer #2322

gmt-it opened this issue Jul 28, 2015 · 43 comments

Comments

@gmt-it
Copy link

gmt-it commented Jul 28, 2015

If you use backspace and delete while you write an answer to a ticket. Cursorposition changed while writing/deleting. I think it is the Save Draft popup.

@gmt-it gmt-it changed the title 1.10 RC1 Wrong Cursor Postioning when edit Ticket Answer 1.10 RC1 Wrong Cursor Postioning while edititing Ticket Answer Jul 28, 2015
@greezybacon
Copy link
Contributor

Could you submit a screenshot? I'm not sure how to produce the issue

@gmt-it
Copy link
Author

gmt-it commented Jul 29, 2015

@greezybacon How to make screenshots of a jumping Cursor? If you write an answer to a ticket and you think a little bit about what you are writing, save draft is shown every second if you write again also a green progress bar is shown at top. If you try to delete the last signs with backspace the cursor is jumping randomly in the text area und if you type a new word ist anywhere in text, not at the end. Also if you use backspace, it seem like the edit area lost focus and browser wants to go back. The "you lost your input" popup pops up.
Would like to have a better English, ist hard to explain for me! But I am learning it a little bit more every day.

@gmt-it
Copy link
Author

gmt-it commented Jul 29, 2015

Tthat happens during the use of backspace:

screen ticketsystem 29 07 2015

screen_001

screen_002

screen_003

@gmt-it
Copy link
Author

gmt-it commented Jul 29, 2015

It seems like if you hit backspace at the moment when "Save Draft" is shown Focus is at "Save draft" and not at edit area. Browser interpreting the backspace key as browser navigation and shows the "You lost changes when leaving page". After going back with Cancel Cursor is elsewhere at edit area. If you use Delete Key after this is happen Cursor jumps randomly to beginn of a row.

@ntozier
Copy link
Contributor

ntozier commented Jul 29, 2015

I am unable to replicate the behavior that you are describing.
Are you sure that your backspace key isn't mapped differently by your web browser?
aka I really think that its the web browser you are using, can you replicate it using a different browser and which one and version are you using?

@gmt-it
Copy link
Author

gmt-it commented Jul 29, 2015

@ntozier I use IE11, latest Firefox and Chrome to test it. Our staff at Switzerland test it on different PCs with Firefox and Chrome. We use also a clean install to test. Same Error. Sometimes it is functional for a few Minutes and then the error occurs again.

@ntozier
Copy link
Contributor

ntozier commented Jul 29, 2015

I'll continue to try to reproduce it then. But so far nothing...

@ntozier
Copy link
Contributor

ntozier commented Jul 29, 2015

I have an idea. Change your language pack to English for your account and see if you can replicate the behavior please.

Also do you ever get the "lock expiring soon" message?

@gmt-it
Copy link
Author

gmt-it commented Jul 29, 2015

@ntozier The clean install is pure English without German de.phar. Error is the same. You should try to open the ticket at two Browsers. One to edit it and one to show it.

@ntozier
Copy link
Contributor

ntozier commented Jul 29, 2015

and the lock message?
I ask because the only way that I can get the Backspace key to function as a broswer back arrow is once the "Your lock is expiring soon" message pops up and hitting the backspace key a couple times. If I click okay then the Del key, it pops up a message reading "The page at webserver.domain.tld says: Any changes or info you've entered will be discarded!" I have not managed to get the cursor to jump around.

@ntozier
Copy link
Contributor

ntozier commented Jul 29, 2015

It seems to me that opening the same ticket in two separate browsers would do weird things because of the ticket lock. So I'm not sure why you would do that.

@gmt-it
Copy link
Author

gmt-it commented Jul 29, 2015

Hmm, our Support Team is sitting in different locations. You can not know who opens the ticket at same time. I think the locking mechanism is for those cases.

@greezybacon
Copy link
Contributor

I think I found it. Could you try this patch?

diff --git a/js/redactor-osticket.js b/js/redactor-osticket.js
index 7b93ebe..769e27a 100644
--- a/js/redactor-osticket.js
+++ b/js/redactor-osticket.js
@@ -40,6 +40,14 @@ RedactorPlugins.draft = function() {
             this.opts.imageUpload = this.opts.autoCreateUrl + '/attach';
             this.opts.imageUploadCallback = this.afterUpdateDraft;
         }
+
+        // FIXME: Monkey patch Redactor's autosave enable method to disable first
+        var oldAse = this.autosave.enable;
+        this.autosave.enable = function() {
+            this.autosave.disable();
+            oldAse.call(this);
+        }.bind(this);
+
         if (autosave_url)
             this.autosave.enable();

It looks like the new version of Redactor has a bug and is registering the draft save system multiple times. I've raised the issue upstream

@gmt-it
Copy link
Author

gmt-it commented Jul 29, 2015

@greezybacon
Patched it, but it is still the same behavior. Try the following. Go to edit area write some rows. delete a lot of letters (not all) with backspace. Most of the time you will see the lost your input popup. Next: Go with Cursor to the middle of a word and press delete. Cusor jumps elsewhere.

@gmt-it
Copy link
Author

gmt-it commented Jul 29, 2015

The cursor just was between to rows. One half at top row other half in row below. Seems like something is working in Background and cursor position is not saved and restored correctly.

@howdu
Copy link

howdu commented Jul 30, 2015

We get the same isssue if your writing fast and making changes to previously written text it messes up the cursor positioning. Each time it auto saves the draft to cursor moves to the start of the editor.

I'd prefer if there was a button to save the draft manually and disable this auto save behaviour.

@gmt-it
Copy link
Author

gmt-it commented Jul 30, 2015

Also, there should be an option to delete draft....

@gmt-it
Copy link
Author

gmt-it commented Jul 30, 2015

Also, if you beginn to edit an answer and you scroll up to read the old messages the continuous auto scroll down is annoying !

@greezybacon
Copy link
Contributor

The trashcan on the toolbar is for deleting the draft....

@greezybacon
Copy link
Contributor

Also, if you beginn to edit an answer and you scroll up to read the old messages the continuous auto scroll down is annoying !

That's really strange. It should only scroll down when you first view the ticket, not a while later after starting to compose a response

@gmt-it
Copy link
Author

gmt-it commented Jul 30, 2015

The trash can I have always overlooked. It's time for glasses now.. ;-(

@howdu
Copy link

howdu commented Aug 5, 2015

Is there a way to disable to drafts?

@adriencarbonne
Copy link

Hello,

We are facing the exact same issue.
Is there a way (patching code manually is OK) to disable the draft feature?

Thank you!

@comfine
Copy link

comfine commented Feb 9, 2017

This is really really very annoying and makes the whole system almost unusable. we had a solution (install Firefox RST 35 (or similar) where the problem does not occur, but now i know, that the customers have the same problems, and so this is not a solution anymore. it would be really great if this bug could be fixed by replacing the WYSIWYG-Editor through another well-working one.

@howdu
Copy link

howdu commented Feb 9, 2017

Since upgrading to the latest from github, I've not had any issues.

@comfine
Copy link

comfine commented Feb 20, 2017

howdu: what version have you installed? we are on v1.10 (901e5ea)

@BlackTiger63
Copy link

I'm interested in a solution too. We're running the same version as comfine (1.10 901e5ea) and still having issues, even after disabling the draft by commenting a line in redactor.js as suggested on the forums.

@woutwoot
Copy link

I'm having the same issue using the latest GitHub version. Has anyone found a solution?

@PeopleInside
Copy link
Contributor

Hi,
yes I AM using a solution who are working and is here:
#2373 (comment)

@woutwoot
Copy link

@PeopleInside Thanks. I'll check whether this fixes the issue.

@BlackTiger63
Copy link

BlackTiger63 commented Mar 24, 2017

@PeopleInside is the fix the combination from uprading to Redactor 10.2.2. to 10.2.5 and adding the line in your comment #2373? Or do we only have to upgrade?
I got 10.2.2 now, how can i upgrade redactor.min.js to 10.2.5?

@PeopleInside
Copy link
Contributor

I have replaced all Redactor content and works. Just followed the comment I mentioned to you.

@BlackTiger63
Copy link

Ah at first I got a blanked out screen, could see the content but was only accessible after a browser refresh.
Probably did something wrong, now I created a new file and pasted the content of your comment and now it works again.
Hopefully the cursor behaviour is fixed with this indeed, thank you very much!!

@comfine
Copy link

comfine commented Mar 25, 2017

BlackTiger63, PeopleInside, as we commented in your post, this will not fix the issue.

@PeopleInside
Copy link
Contributor

@comfine for me has helped.

@comfine
Copy link

comfine commented Mar 25, 2017

@PeopleInside with which browser? i am pretty sure, that it will not solve it within the newest firefox version! ...only the old 35.x (or something similar - i forgot...) RST-Release works well....and other Browsers maybe - but we cannot tell our customers which browser they have to use...

PS: i reloaded the ostickets-backend now by pressing STRG+F5 - maybe the old JS-File was still in the cache and maybe this caused the issue - i will report back....

@comfine
Copy link

comfine commented Apr 27, 2017

so - problem still occurs!
Cursor jumps arround sometimes... for example, when i write in the middle of a written text, sometimes the cursor just jumps to the next line while i type in some letters, so this is not the backspace-problem... but still a "Cursor-Jumping-Problem".

@PeopleInside: can you please tell me which OperatingSystem you use?

@BlackTiger63
Copy link

I don't seem to have any problems anymore after what I answered before on March 24.
Don't encounter any backspace issues or jumping cursors until now.
I got Centos 6.9, Php 5.6.30 and Apache 2.4.25.

@comfine
Copy link

comfine commented Apr 27, 2017

@BlackTiger63 and @PeopleInside can you tell us which OS you use? this could really help to find out why we still have this issue!

Sorry, BlackTiger63, you have CentOS as Client-System or Server-System? Important is the Client-OS, also the Browser you use!

@BlackTiger63
Copy link

BlackTiger63 commented Apr 27, 2017

I'm sorry. My CentOs is server-system.
My client system is Windows 7 Professional 64-bit with Firefox 53.0 32-bits.

Last week I also had that jumping cursor but aren't able to reproduce it either anymore.

@JediKev JediKev closed this as completed Jan 6, 2020
@comfine
Copy link

comfine commented Jan 7, 2020

why are all these bugs simply closed? they are still persist and still annoying!

@ntozier
Copy link
Contributor

ntozier commented Jan 7, 2020

@comfine are you still experiencing this in 1.14.1?

This issue was close since it is 2015, reported on an end of life version, and had not been updated for over 2 years. Since then Redactor has been upgraded and draft behavior was changed.

@comfine
Copy link

comfine commented Jan 14, 2020

@ntozier: unfortunatelly, yes, we do still see this in 1.14.1!
i would say it is not that worse (often) than in those days, but sometimes still the cursor-position just jumps to a wrong position, yes! within my experience it happens mostly when i use the backspace-key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants