Skip to content

Commit

Permalink
Fix error with fake selection (codex-team#595)
Browse files Browse the repository at this point in the history
* fix bag fakeSelection (codex-team#590)
  • Loading branch information
horoyami authored Jan 22, 2019
1 parent 67d5571 commit 3842595
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/codex-editor.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
5 changes: 0 additions & 5 deletions src/components/selection.ts
Original file line number Diff line number Diff line change
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 3842595

Please sign in to comment.