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

Conflict with ibus IME if highlighting is enabled #103

Open
hongquan opened this issue Aug 4, 2023 · 8 comments
Open

Conflict with ibus IME if highlighting is enabled #103

hongquan opened this issue Aug 4, 2023 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@hongquan
Copy link

hongquan commented Aug 4, 2023

I'm integrating codejar with my personal website, a Vietnamese blog. I use ibus-unikey, on Ubuntu, to input Vietnamese, and encounter an issue that, very often, uncommited chars are lost.

I found that codejar is relying on event.isComposing to detect if the IME is in its task. But actually, it is not reliable. You can read more here: https://lists.w3.org/Archives/Public/public-editing-tf/2015Nov/0001.html

@antonmedv
Copy link
Owner

So what is the best way to fix this?

@hongquan
Copy link
Author

hongquan commented Aug 4, 2023

Just to inform. I haven't had solution yet. I may look into other web-based editors (CodeMirror, Monaco Editor etc.) to see if they suffer this. It may take time.

@antonmedv antonmedv added the help wanted Extra attention is needed label Aug 4, 2023
@hongquan
Copy link
Author

I found that other editors overcome this issue by creating a copy of input text, put it on top of the original one (using z-index), and apply highlighting to that copy, instead of the original one.

What I'm not clear is that how they let user see the caret (text cursor), which actually belongs to the original text input.

@antonmedv
Copy link
Owner

Yes and codejar uses other approach with contenteditable. Both methods have advantages and disadvantages.

@hongquan
Copy link
Author

Other editors also use contenteditable. The difference is that, other editors apply highlighting to the copy of input texts, whereas CodeJar does directly on the being-edited one.

@antonmedv
Copy link
Owner

contenteditable or textarea+copy

I never seen an editor with contenteditable set to transparent and copy of text for highlighting. Usually textarea is used.

@hongquan
Copy link
Author

This one https://editor.kullna.org/demo.html is using contenteditable + copy.

@antonmedv
Copy link
Owner

Hmm, very interesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants