Skip to content

Commit

Permalink
🐛 fix #216
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Mar 11, 2020
1 parent b5e8692 commit 4046c63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@

* [open issues](https://github.com/Vanessa219/vditor/issues)

### v2.3.0 / 未发布

* [216](https://github.com/Vanessa219/vditor/issues/216) subtoolbar 向下溢出 `修复缺陷`

### v2.2.19 / 2020-03-10

* [214](https://github.com/Vanessa219/vditor/issues/214) wysiwyg heading id `引入特性`
Expand Down
4 changes: 2 additions & 2 deletions src/ts/wysiwyg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ class WYSIWYG {
if (this.popover.style.display !== "block") {
return;
}
this.popover.style.top = Math.max(-11,
parseInt(this.popover.getAttribute("data-top"), 10) - vditor.wysiwyg.element.scrollTop) + "px";
const top = parseInt(this.popover.getAttribute("data-top"), 10) - vditor.wysiwyg.element.scrollTop;
this.popover.style.top = Math.max(-11, Math.min(top, this.element.clientHeight - 21)) + "px";
});

this.element.addEventListener("copy", (event: ClipboardEvent & { target: HTMLElement }) => {
Expand Down

0 comments on commit 4046c63

Please sign in to comment.