Skip to content

Commit

Permalink
Fix width in default calculatePosition
Browse files Browse the repository at this point in the history
Use the `width` from `getBoundingClientRect` as the default for `calculatePosition`.

Fixes sagalbot#1113
  • Loading branch information
tochoromero authored Mar 17, 2020
1 parent ca4f3c4 commit b520151
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/directives/appendToBody.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export default {
inserted (el, bindings, {context}) {
if (context.appendToBody) {
const {height, top, left} = context.$refs.toggle.getBoundingClientRect();
const {height, top, left, width} = context.$refs.toggle.getBoundingClientRect();

el.unbindPosition = context.calculatePosition(el, context, {
width: context.$refs.toggle.clientWidth + 'px',
width: width + 'px',
top: (window.scrollY + top + height) + 'px',
left: (window.scrollX + left) + 'px',
});
Expand Down

0 comments on commit b520151

Please sign in to comment.