Skip to content

Commit

Permalink
fix(ui/list): remove isHidden function
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Jan 19, 2022
1 parent 1dba5e2 commit a4634e0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
6 changes: 1 addition & 5 deletions packages/varlet-ui/src/list/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import VarLoading from '../loading'
import Ripple from '../ripple'
import { defineComponent, onMounted, onUnmounted, ref, nextTick } from 'vue'
import { getParentScroller, isHidden, toPxNum } from '../utils/elements'
import { getParentScroller, toPxNum } from '../utils/elements'
import { props } from './props'
import { isNumber, dt } from '../utils/shared'
import { pack } from '../locale'
Expand Down Expand Up @@ -64,10 +64,6 @@ export default defineComponent({
const check = async () => {
await nextTick()
if (isHidden(listEl.value as HTMLElement)) {
return
}
const { loading, finished, error } = props
if (!loading && !finished && !error && isReachBottom()) {
Expand Down
6 changes: 0 additions & 6 deletions packages/varlet-ui/src/utils/elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ export function getTranslate(el: HTMLElement) {
return +transform.slice(transform.lastIndexOf(',') + 2, transform.length - 1)
}

export function isHidden(el: HTMLElement) {
const { width, height } = el.getBoundingClientRect()

return width === 0 && height === 0
}

export function getParentScroller(el: HTMLElement): HTMLElement | Window {
let element = el

Expand Down

0 comments on commit a4634e0

Please sign in to comment.