Skip to content

Commit 3842595

Browse files
authored
Fix error with fake selection (codex-team#595)
* fix bag fakeSelection (codex-team#590)
1 parent 67d5571 commit 3842595

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

‎dist/codex-editor.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### 2.7.29
4+
5+
- `Fix` Fixed selection behavior when text has modifiers from Inline Toolbar
6+
37
### 2.7.28
48

59
- `New` [Tools Validation](https://github.com/codex-team/codex.editor/blob/master/docs/tools.md#validate-optional) is added.

‎src/components/selection.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,7 @@ export default class SelectionUtils {
225225
if (!this.isFakeBackgroundEnabled) {
226226
return;
227227
}
228-
const fakeBack = this.findParentTag('SPAN');
229228

230-
fakeBack.style.paddingTop = '';
231229
this.isFakeBackgroundEnabled = false;
232230
document.execCommand(this.commandRemoveFormat);
233231
}
@@ -237,10 +235,7 @@ export default class SelectionUtils {
237235
*/
238236
public setFakeBackground() {
239237
document.execCommand(this.commandBackground, false, '#a8d6ff');
240-
const fakeBack = this.findParentTag('SPAN');
241238

242-
// The matched value to be slightly compared with the actual height of the selection
243-
fakeBack.style.paddingTop = '0.30em';
244239
this.isFakeBackgroundEnabled = true;
245240
}
246241

0 commit comments

Comments
 (0)