Fix error with fake selection (#595)

* fix bag fakeSelection (#590)
This commit is contained in:
horoyami 2019-01-22 14:04:49 +03:00 committed by GitHub
parent 67d557120c
commit 3842595c24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,9 @@
# Changelog
### 2.7.29
- `Fix` Fixed selection behavior when text has modifiers from Inline Toolbar
### 2.7.28
- `New` [Tools Validation](https://github.com/codex-team/codex.editor/blob/master/docs/tools.md#validate-optional) is added.

View file

@ -225,9 +225,7 @@ export default class SelectionUtils {
if (!this.isFakeBackgroundEnabled) {
return;
}
const fakeBack = this.findParentTag('SPAN');
fakeBack.style.paddingTop = '';
this.isFakeBackgroundEnabled = false;
document.execCommand(this.commandRemoveFormat);
}
@ -237,10 +235,7 @@ export default class SelectionUtils {
*/
public setFakeBackground() {
document.execCommand(this.commandBackground, false, '#a8d6ff');
const fakeBack = this.findParentTag('SPAN');
// The matched value to be slightly compared with the actual height of the selection
fakeBack.style.paddingTop = '0.30em';
this.isFakeBackgroundEnabled = true;
}