Skip to content

Editor line shift when inserting emoji #509

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

Closed
hellow554 opened this issue Jul 4, 2019 · 3 comments
Closed

Editor line shift when inserting emoji #509

hellow554 opened this issue Jul 4, 2019 · 3 comments
Labels
upstream Caused by a third-party component

Comments

@hellow554
Copy link

As you can see, if one adds an emoji, the line gets slightly shifted downwards and therefore interferes with the next line

grafik

grafik

@shepmaster shepmaster added the upstream Caused by a third-party component label Jul 4, 2019
@shepmaster
Copy link
Member

This is apparently a problem with Ace, as the demo on their website does the same. Can you check their repo for the root issue or any fixes?

@nightwing
Copy link

This is indeed a bug in ace. Line text shifts because line-height: normal changes based on font. As a temporary workaround until the next version of ace is released you can use

.ace_editor {
    line-height: 1.4;
}

or

function onChangeCharacterSize() {
    editor.renderer.scroller.style.lineHeight = editor.renderer.lineHeight + "px"
}
onChangeCharacterSize()
editor.renderer.on("changeCharacterSize", onChangeCharacterSize)

@shepmaster
Copy link
Member

Resolved by upgrading Ace, thank you @nightwing! 😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Caused by a third-party component
Projects
None yet
Development

No branches or pull requests

3 participants