Skip to content

Commit

Permalink
fix(scroll) fix scroll mousex offset to be relative (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenjennings authored Oct 11, 2018
1 parent c171c27 commit ec1f22f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-autosuggest",
"version": "1.7.1",
"version": "1.7.1-1",
"description": "Vue autosuggest component.",
"engines": {
"node": "> 4",
Expand Down
7 changes: 4 additions & 3 deletions src/Autosuggest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,12 @@ export default {
this.currentIndex = index;
},
clickedOnScrollbar(mouseX){
const results = document.querySelector(`.${this.componentAttrClassAutosuggestResultsContainer}`);
return results.offsetWidth <= mouseX;
const results = document.querySelector(`.${this.componentAttrClassAutosuggestResults}`);
return results.clientWidth <= (mouseX + 16);
},
onDocumentMouseDown(e) {
this.clientXMouseDownInitial = e.clientX
var rect = e.target.getBoundingClientRect ? e.target.getBoundingClientRect() : 0;
this.clientXMouseDownInitial = e.clientX - rect.left;
},
onDocumentMouseUp(e) {
/** Do not re-render list on input click */
Expand Down

0 comments on commit ec1f22f

Please sign in to comment.