Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll bar is not working when we use it in a modal popup #136

Open
vishvanathaa opened this issue Oct 22, 2021 · 2 comments
Open

Scroll bar is not working when we use it in a modal popup #136

vishvanathaa opened this issue Oct 22, 2021 · 2 comments

Comments

@vishvanathaa
Copy link

When we used it inside modal popup, The auto complete list disappears when we try to scroll bar using mouse.
scroll bar issue

@dustintenney
Copy link

Same issue any luck finding a fix for this?

@sundlee
Copy link

sundlee commented Dec 2, 2022

Even though it is late, I am writing a workaround for the issue.

'onMouseDown' will check if cursor position is on scroll bar when 'mousedown' event is detected. If cursor position is on scroll bar, the modal popup will not be hidden by v-show with 'isFocused' variable.

Good luck with this!


data() {
return {
...
isClickedScrollbar: false,
};
},

methods: {
...
runFocusOut(tgt) {
setTimeout(() => {
if ((tgt && tgt.classList.contains('vbst-item'))) {
return;
}
if (this.isClickedScrollbar === true) {
this.isClickedScrollbar = false;
return;
}
this.isFocused = false;
}, 100);
},

onMouseDown(e) {
  if (e.offsetX > e.target.clientWidth || e.offsetY > e.target.clientHeight) {
    this.isClickedScrollbar = true;
  } else {
    this.isClickedScrollbar = false;
  }
},

},

mounted() {
...
window.addEventListener('mousedown', this.onMouseDown);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants