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

Multi-byte input in multi-line input form does not behave properly. #1543

Open
Yuutakasan opened this issue Jun 9, 2021 · 9 comments
Open
Labels

Comments

@Yuutakasan
Copy link

Yuutakasan commented Jun 9, 2021

In the API edit screen, copying and pasting the following characters into a form and then entering and deleting single byte characters after the following characters causes strange behavior.
A strange phenomenon occurs in the markdown input and source editing screens. Is it possible to fix this?

It is hard to explain in words, but it seems that the middle of multi-byte characters are deleted, and single-byte characters that should have been deleted are still displayed.

ああ⇒ああ⇒ああaa

I think I am having a problem with the multi-line input form.
The following is the form just after copying and pasting. Normally, after pasting, the input position on the keyboard is supposed to be right after the pasted character, but since the input position is at the end of the multibyte character, it is behaving strangely at this point.
image
image

I don't seem to have the same problem with the single line input form.
image

@Yuutakasan Yuutakasan changed the title The delete key does not behave properly when some multi-byte inputs are entered on the input form. Multi-byte input in multi-line input form does not behave properly. Jun 9, 2021
@EricWittmann
Copy link
Member

This might be a bug in the Ace editor itself...I'm not sure. :(

@Yuutakasan
Copy link
Author

Yuutakasan commented Jun 11, 2021

I have seen the same phenomenon.
But ,I can't put it into words very clearly, but I somehow feel that Apicurio's symptoms are more strange.

https://ace.c9.io/#nav=embedding
image

I've posted an Issue to the Ace Editor.
ajaxorg/ace#4512

@Yuutakasan
Copy link
Author

It's a little strange, but I think it's less of a problem with the current latest version of AceEditor; upgrading the version of Ace Editor in Apicurio studio might help.

@EricWittmann
Copy link
Member

The problem there is that we're pulling in the Ace editor via brace which appears to no longer be updated with the latest Ace editor. We'll probably need a bit more work to upgrade Ace than just tweaking the version # in package.json sadly.

@Yuutakasan
Copy link
Author

Yuutakasan commented Jun 23, 2021

@EricWittmann
I think ace-build is the original, but is there a reason why you use brace?

@Yuutakasan
Copy link
Author

@EricWittmann
I found out that there is a problem with the isFullWidth method of the brace package, which has not been updated for several years.

I found that I can work around the problem by applying a patch like this.
https://gist.github.com/sinkuu/021ca0d9f6878dc6165ccf6d784075c4

@EricWittmann
Copy link
Member

I don't recall whether ace-build didn't work or I just didn't know about it. brace is the browserify compatible version. Not sure whether ace-builds is also compatible with browserify. We're very outdated on a lot of our UI stuff. We really need to upgrade to React, Patternfly 4, etc. But that's a ton of work.

@EricWittmann
Copy link
Member

Interesting patch! I wonder if we could apply that patch during the build in some way.

@Yuutakasan
Copy link
Author

Yuutakasan commented Jun 29, 2021

@EricWittmann
After checking, I realized that this patch was wrong, and I'm working on fixing it. I'm working on a fix for the patch and will send you a PR.

We have been informed that there is a problem in Thai, so it seems that we need to include this support for each language when considering other language versions. For Japanese, the problem will be solved by a patch that we are preparing.
ajaxorg/ace#4512

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

No branches or pull requests

2 participants