Skip to content

Commit 69a8323

Browse files
committed
fix: Fix bugs
1 parent 4a5df5d commit 69a8323

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

spec/utils/getTargetTeg.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ describe('src/utils/getTargetTag', () => {
1717
})
1818

1919
describe('when given Chrome UserAgent', () => {
20-
it('returns "body"', () => {
20+
it('returns "html"', () => {
2121
const userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36'
2222
const documentElement = {
2323
style: ['WebkitAppearance']
2424
}
25-
expect(getTargetTag(userAgent)).toBe('body')
25+
expect(getTargetTag(userAgent)).toBe('html')
2626
})
2727
})
2828
})

src/components/vue-fixed-header.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ export default Vue.extend({
5454
if (!tag) {
5555
return
5656
}
57-
if (this.isFixed !== qs(tag).scrollTop > threshold) {
57+
console.log(
58+
tag
59+
)
60+
// if (this.isFixed !== qs(tag).scrollTop > threshold) {
5861
this.isFixed = qs(tag).scrollTop > threshold
5962
this.$forceUpdate()
60-
}
63+
// }
6164
}
6265
},
6366
registerEvent() {

src/utils/getTargetTag.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function getTargetTag(userAgent: string): 'html' | 'body' {
66
return 'html'
77
}
88
if (userAgent.includes('Chrome') && !userAgent.includes('opr')) {
9-
return 'body'
9+
return 'html'
1010
}
1111
return 'html'
1212
}

0 commit comments

Comments
 (0)