Skip to content

Commit

Permalink
fix bag fakeSelection (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor K. Vinogradov committed Jan 12, 2019
1 parent fc3e146 commit 29d398c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
10 changes: 5 additions & 5 deletions dist/codex-editor.js

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions src/components/selection.ts
Expand Up @@ -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);
}
Expand All @@ -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;
}

Expand Down

0 comments on commit 29d398c

Please sign in to comment.