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

Replace a text put the first character of the new text at the last position #7

Closed
jcgueriaud1 opened this issue Apr 27, 2021 · 6 comments
Labels
bug Something isn't working fixed in live Bug has been fixed and has been uploaded to the directory

Comments

@jcgueriaud1
Copy link
Contributor

Describe the bug
When I select a text in the ace editor and type a new text the first character is at the last position.

To Reproduce
Steps to reproduce the behavior:

  • In the aceeditor, type "CONTENT"
  • Select the text "CONTENT", type "123456"
  • The result is "234561"

Expected behavior
The result should be: "123456"

Screenshots
https://user-images.githubusercontent.com/51313578/116244662-ce0bfd00-a770-11eb-9965-56dc1f1b7a0f.mov

I've got this issue in Vaadin 14.5.3 + v1.1.0.

But also when I pull the master branch and run mvn jetty:run

@F0rce F0rce added bug Something isn't working in progress A issue / feature request that is being worked on labels Apr 28, 2021
@F0rce
Copy link
Owner

F0rce commented Apr 29, 2021

Hello @jcgueriaud1,

I have some problems recreating your issue. When I start my ace editor and use your given steps, the result is "123456".

Could you maybe tell me the settings you use for the ace editor itself ? (java methods, size, etc.)

Thanks in advance,
David

@F0rce F0rce added the awaiting answer Awaiting the answer of the creator of the issue/feature request. label Apr 29, 2021
@jcgueriaud1
Copy link
Contributor Author

jcgueriaud1 commented Apr 29, 2021

I'm able to reproduce it in the demo, I didn't change the code: https://github.com/F0rce/ace/blob/master/src/test/java/de/f0rce/View.java
I pulled the master branch and run mvn jetty:run.

When I replace a text and type a character the cursor is placed before the character.
If I select the text and type backspace then the text it's working.

I'm using Mac, Java11. I don't know if it matters.
I also tried the demo here: https://ace.c9.io/ and this demo is working

@F0rce F0rce removed the awaiting answer Awaiting the answer of the creator of the issue/feature request. label Apr 29, 2021
@F0rce
Copy link
Owner

F0rce commented Apr 29, 2021

super, super wierd.

I'll absolutely have to give it a major investigation. Because I really cant reproduce it. Im on Windows with Java 8 but i'm gonna setup the ace editor on my mac with the same java version as you.

I'll give it high priority

@F0rce
Copy link
Owner

F0rce commented Apr 29, 2021

Update:

I reverted some of my changes to the frontend in my local test szenario and was able to reproduce the issue, i'm working on a fix :)

@jcgueriaud1
Copy link
Contributor Author

Thanks a lot for your fast answer.

@F0rce
Copy link
Owner

F0rce commented May 17, 2021

I have discovered, what this issue caused. It has to do with Ace Editor's selectionChange event, which triggers more often than usual. This also seems to be the issue of for the other issue (can't tag on mobile). I'll try to write a debounce version of the selectionChange Event.

Have a great day and sorry for the lack of support,
David

@F0rce F0rce closed this as completed in 4597940 May 25, 2021
@F0rce F0rce added fixed (locally) Bug has been fixed in my workspace, but isn't uploaded to the directory yet fixed in live Bug has been fixed and has been uploaded to the directory and removed Priority: High in progress A issue / feature request that is being worked on fixed (locally) Bug has been fixed in my workspace, but isn't uploaded to the directory yet labels May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in live Bug has been fixed and has been uploaded to the directory
Projects
None yet
Development

No branches or pull requests

2 participants