[Bug Report] sticky组件的isSupportSticky函数返回结果总是false
- Langage dominant
- Vue
- Étoiles
- 17.5k
- Forks
- 3.6k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
### VUX version
2.9.4
### OS/Browsers version
ios:12.2
android:6.0.1
### Vue version
2.6.10
### Code
```html
// 判断是否支持sticky属性
function isSupportSticky () {
var prefixTestList = ['', '-webkit-', '-ms-', '-moz-', '-o-']
var stickyText = ''
for (var i = 0; i < prefixTestList.length; i ) {
stickyText = 'position:' prefixTestList[i] 'sticky'
}
// 创建一个dom来检查
var div = document.createElement('div')
var body = document.body
div.style.cssText = 'display:none' stickyText
body.appendChild(div)
var isSupport = /sticky/i.test(window.getComputedStyle(div).position)
body.removeChild(div)
div = null
return isSupport
}
```
### Steps to reproduce
ios6 以上本来支持position:sticky,但是isSupportSticky 函数总是返回false。
### What is Expected?
// 判断是否支持sticky属性
function isSupportSticky () {
var prefixTestList = ['', '-webkit-', '-ms-', '-moz-', '-o-']
var stickyText = ''
for (var i = 0; i < prefixTestList.length; i ) {
stickyText = 'position:' prefixTestList[i] 'sticky;'; //增加;
}
// 创建一个dom来检查
var div = document.createElement('div')
var body = document.body
div.style.cssText = 'display:none;' stickyText //增加;
body.appendChild(div)
var isSupport = /sticky/i.test(window.getComputedStyle(div).position)
body.removeChild(div)
div = null
return isSupport
}
### What is actually happening?
ios6 以上以及高版本安卓机测试isSupportSticky 函数返回true。
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.