alibaba / weex

A framework for building Mobile cross-platform UI
https://weexapp.com/
Apache License 2.0
18.27k stars 2.13k forks source link

[Discuss] web tag on ios safari #401

Closed IskenHuang closed 8 years ago

IskenHuang commented 8 years ago

I got a issues about web tag on my project. Web tag on iOS safari can not scrolling. Code as below:

<template>
    <div>
        <web id="iframe" class="fullscreen ios-scroll-hack" src="https://www.tmall.com"></web>
    </div>
</template>

<style>
.fullscreen {
    position: absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
}
.ios-scroll-hack {
    -webkit-overflow-scrolling: touch;
    overflow: auto;
}
</style>

After the rendering will be:

<div class="weex-container" data-ref="3" style="position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px;">
    <iframe class="weex-element" src="https://www.tmall.com" style="width: 100%; height: 100%;"></iframe>
</div>

The data-ref="3" is created by Weex web rendering. Is passable add the new class like .ios-scroll-hack on iframe's parent node. In my opinion it should be build on Weex web rendering.

MrRaindrop commented 8 years ago

OK.. This code should be imported soon. Thx for your tip