Skip to content

Wheel events #385

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

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
revert animated scroll
  • Loading branch information
saibhavateja1 committed Jun 3, 2022
commit ff807494e38f5d368f2f40c8ef5a6938ab9bc74c
22 changes: 9 additions & 13 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
*/

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('vue'), require('animated-scroll-to')) :
typeof define === 'function' && define.amd ? define(['vue', 'animated-scroll-to'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.VirtualList = factory(global.Vue, global.animateScrollTo));
})(this, (function (Vue, animateScrollTo) { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('vue')) :
typeof define === 'function' && define.amd ? define(['vue'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.VirtualList = factory(global.Vue));
})(this, (function (Vue) { 'use strict';

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var Vue__default = /*#__PURE__*/_interopDefaultLegacy(Vue);
var animateScrollTo__default = /*#__PURE__*/_interopDefaultLegacy(animateScrollTo);

function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
Expand Down Expand Up @@ -826,14 +825,11 @@
if (this.pageMode) {
// document.documentElement[this.directionKey] = offset
// document.body[this.directionKey] = offset
animateScrollTo__default["default"]([this.isHorizontal ? offset : 0, this.isHorizontal ? offset : 0], {
speed: 100,
elementToScroll: window
}); // window.scrollTo({
// top: this.isHorizontal ? 0 : offset,
// left: this.isHorizontal ? offset : 0,
// behavior: 'smooth'
// })
window.scrollTo({
top: this.isHorizontal ? 0 : offset,
left: this.isHorizontal ? offset : 0,
behavior: 'smooth'
});
} else {
var root = this.$refs.root;

Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
"url": "https://github.com/tangbc/vue-virtual-scroll-list/issues"
},
"homepage": "https://github.com/tangbc/vue-virtual-scroll-list#readme",
"dependencies": {
"animated-scroll-to": "^2.2.0"
},
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.8.7",
"@babel/preset-env": "^7.8.7",
Expand Down
14 changes: 4 additions & 10 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import Virtual from './virtual'
import { Item, Slot } from './item'
import { VirtualProps } from './props'

import animateScrollTo from 'animated-scroll-to'

const EVENT_TYPE = {
ITEM: 'item_resize',
SLOT: 'slot_resize'
Expand Down Expand Up @@ -152,15 +150,11 @@ const VirtualList = Vue.component('virtual-list', {
if (this.pageMode) {
// document.documentElement[this.directionKey] = offset
// document.body[this.directionKey] = offset
animateScrollTo([this.isHorizontal ? offset : 0, this.isHorizontal ? offset : 0], {
speed: 100,
elementToScroll: window
window.scrollTo({
top: this.isHorizontal ? 0 : offset,
left: this.isHorizontal ? offset : 0,
behavior: 'smooth'
})
// window.scrollTo({
// top: this.isHorizontal ? 0 : offset,
// left: this.isHorizontal ? offset : 0,
// behavior: 'smooth'
// })
} else {
const { root } = this.$refs
if (root) {
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1328,11 +1328,6 @@ ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4:
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"

animated-scroll-to@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/animated-scroll-to/-/animated-scroll-to-2.2.0.tgz#0aea20d4d800e3e8bfd1504041091276f9593360"
integrity sha512-VVhwrii9tMXwP1GlQacLplUrh/0x2IbU/JxTUMBvzam6lJpJ9jMCw8PKHOvqMJ52vYmBDfcf9lNDuSeoWCD/mw==

ansi-escapes@^4.2.1:
version "4.3.2"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e"
Expand Down