vinck
vinck
  • 发布:2015-01-15 12:15
  • 更新:2015-01-22 21:31
  • 阅读:4284

【产品bug】有checkbox的页面,点击checkbox,底部选项卡会跳到顶部

分类:MUI

用HBuilder自带的测试案列tabbar.html,修改某个选项卡的内容,增加

<form class="mui-input-group">  
    <div class="mui-input-row mui-checkbox">  
        <label>a</label>  
        <input name="checkbox1" type="checkbox" >  
    </div>  
    <div class="mui-input-row mui-checkbox">  
        <label>b</label>  
        <input name="checkbox2" type="checkbox">  
    </div>  
    <div class="mui-input-row mui-checkbox">  
        <label>c</label>  
        <input name="checkbox3" type="checkbox">  
    </div>  
</form>

点击里面的checkbox,底部选项卡会跳到顶部,完整html代码如下:

<!DOCTYPE html>  
<html>  

    <head>  
        <meta charset="utf-8">  
        <title>Hello MUI</title>  
        <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">  
        <meta name="apple-mobile-web-app-capable" content="yes">  
        <meta name="apple-mobile-web-app-status-bar-style" content="black">  
        <link rel="stylesheet" href="../css/mui.min.css">  
        <script src="../js/mui.min.js"></script>  
        <script src="../js/app.js"></script>  
        <style>  
            html,body {  
                background-color: #efeff4;  
            }  
            header.mui-bar{  
                display: none;  
            }  
            .mui-bar-nav~.mui-content{  
                padding-top: 0;  
            }  
            .title{  
                margin: 20px 15px 10px;  
                color: #6d6d72;  
                font-size: 15px;  
            }  

            .oa-contact-cell.mui-table .mui-table-cell {  
                padding: 11px 0;  
                vertical-align: middle;  
            }  

            .oa-contact-cell {  
                position: relative;  
                margin: -11px 0;  
            }  

            .oa-contact-avatar {  
                width: 75px;  
            }  
            .oa-contact-avatar img {  
                border-radius: 50%;  
            }  
            .oa-contact-content {  
                width: 100%;  
            }  
            .oa-contact-name {  
                margin-right: 20px;  
            }  
            .oa-contact-name, oa-contact-position {  
                float: left;  
            }  
        </style>  
        <script>  
            mui.init();  
        </script>  
    </head>  

    <body>  
        <header class="mui-bar mui-bar-nav">  
            <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>  
            <h1 class="mui-title">选项卡(Tab)</h1>  
        </header>  
        <nav class="mui-bar mui-bar-tab">  
            <a class="mui-tab-item mui-active" href="#tabbar">  
                <span class="mui-icon mui-icon-home"></span>  
                <span class="mui-tab-label">首页</span>  
            </a>  
            <a class="mui-tab-item" href="#tabbar-with-chat">  
                <span class="mui-icon mui-icon-email"><span class="mui-badge">9</span></span>  
                <span class="mui-tab-label">消息</span>  
            </a>  
            <a class="mui-tab-item" href="#tabbar-with-contact">  
                <span class="mui-icon mui-icon-contact"></span>  
                <span class="mui-tab-label">通讯录</span>  
            </a>  
            <a class="mui-tab-item" href="#tabbar-with-map">  
                <span class="mui-icon mui-icon-gear"></span>  
                <span class="mui-tab-label">设置</span>  
            </a>  
        </nav>  
        <div class="mui-content">  
            <div id="tabbar" class="mui-control-content mui-active">  
                <div class="title">这是div模式选项卡中的第1个子页面.</div>  
                <div class="title">何谓div模式的选项卡?  
                    其实就是通过DIV模拟一个独立页面,通过DIV的显示、隐藏模拟不同页面的切换,典型的SPA模式;</div>  
                <div class="title">  
                    这种模式适合简单业务系统,因为每个选项卡内容要写在一个DIV中,  
                    若逻辑复杂,会导致当前页面DOM结构繁杂,造成webview响应缓慢,甚至崩溃;  
                    因此若系统较复杂,需要下拉刷新等操作,推荐使用webview模式的选项卡;</div>  
            </div>  
            <div id="tabbar-with-chat" class="mui-control-content">  
                <div class="title">这是div模式选项卡中的第2个子页面,该页面展示一个消息列表</div>  

                <form class="mui-input-group">  
                    <div class="mui-input-row mui-checkbox">  
                        <label>a</label>  
                        <input name="checkbox1" type="checkbox" >  
                    </div>  
                    <div class="mui-input-row mui-checkbox">  
                        <label>b</label>  
                        <input name="checkbox2" type="checkbox">  
                    </div>  
                    <div class="mui-input-row mui-checkbox">  
                        <label>c</label>  
                        <input name="checkbox3" type="checkbox">  
                    </div>  

                </form>  

                <ul class="mui-table-view mui-table-view-chevron">  
                    <li class="mui-table-view-cell"><a href="" class="mui-navigate-right">Item 1</a></li>  
                    <li class="mui-table-view-cell"><a href="" class="mui-navigate-right">Item 2</a></li>  
                    <li class="mui-table-view-cell"><a href="" class="mui-navigate-right">Item 3</a></li>  
                    <li class="mui-table-view-cell"><a href="" class="mui-navigate-right">Item 4</a></li>  
                    <li class="mui-table-view-cell"><a href="" class="mui-navigate-right">Item 5</a></li>  
                    <li class="mui-table-view-cell"><a href="" class="mui-navigate-right">Item 6</a></li>  
                    <li class="mui-table-view-cell"><a href="" class="mui-navigate-right">Item 7</a></li>  
                    <li class="mui-table-view-cell"><a href="" class="mui-navigate-right">Item 8</a></li>  
                    <li class="mui-table-view-cell"><a href="" class="mui-navigate-right">Item 9</a></li>  
                </ul>  

            </div>  
            <div id="tabbar-with-contact" class="mui-control-content">  
                <div class="title">这是div模式选项卡中的第3个子页面,该页面展示一个通讯录示例.</div>  
                <ul class="mui-table-view mui-table-view-striped mui-table-view-condensed">  
                <li class="mui-table-view-cell">  
                    <div class="mui-slider-cell">  
                        <div class="oa-contact-cell mui-table">  
                            <div class="oa-contact-avatar mui-table-cell">  
                                <img src="../images/60x60.gif" />  
                            </div>  
                            <div class="oa-contact-content mui-table-cell">  
                                <div class="mui-clearfix">  
                                    <h4 class="oa-contact-name">解缙</h4>  
                                    <span class="oa-contact-position mui-h6">文化部长</span>  
                                </div>  
                                <p class="oa-contact-email mui-h6">  
                                    chunyu@sina.com  
                                </p>  
                            </div>  
                        </div>  
                    </div>  
                </li>  
                <li class="mui-table-view-cell">  
                    <div class="mui-slider-cell">  
                        <div class="oa-contact-cell mui-table">  
                            <div class="oa-contact-avatar mui-table-cell">  
                                <img src="../images/60x60.gif" />  
                            </div>  
                            <div class="oa-contact-content mui-table-cell">  
                                <div class="mui-clearfix">  
                                    <h4 class="oa-contact-name">张聪聪</h4>  
                                    <span class="oa-contact-position mui-h6">理事长</span>  
                                </div>  
                                <p class="oa-contact-email mui-h6">  
                                    zcc@163.com  
                                </p>  
                            </div>  
                        </div>  
                    </div>  
                </li>  
                <li class="mui-table-view-cell">  
                    <div class="mui-slider-cell">  
                        <div class="oa-contact-cell mui-table">  
                            <div class="oa-contact-avatar mui-table-cell">  
                                <img src="../images/60x60.gif" />  
                            </div>  
                            <div class="oa-contact-content mui-table-cell">  
                                <div class="mui-clearfix">  
                                    <h4 class="oa-contact-name">马三保</h4>  
                                    <span class="oa-contact-position mui-h6">海军司令</span>  
                                </div>  
                                <p class="oa-contact-email mui-h6">  
                                    zhenghe@126.com  
                                </p>  
                            </div>  
                        </div>  
                    </div>  
                </li>  
                <li class="mui-table-view-cell">  
                    <div class="mui-slider-cell">  
                        <div class="oa-contact-cell mui-table">  
                            <div class="oa-contact-avatar mui-table-cell">  
                                <img src="../images/60x60.gif" />  
                            </div>  
                            <div class="oa-contact-content mui-table-cell">  
                                <div class="mui-clearfix">  
                                    <h4 class="oa-contact-name">朱棣</h4>  
                                    <span class="oa-contact-position mui-h6">董事长</span>  
                                </div>  
                                <p class="oa-contact-email mui-h6">  
                                    zcc@163.com  
                                </p>  
                            </div>  
                        </div>  
                    </div>  
                </li>  
                <li class="mui-table-view-cell">  
                    <div class="mui-slider-cell">  
                        <div class="oa-contact-cell mui-table">  
                            <div class="oa-contact-avatar mui-table-cell">  
                                <img src="../images/60x60.gif" />  
                            </div>  
                            <div class="oa-contact-content mui-table-cell">  
                                <div class="mui-clearfix">  
                                    <h4 class="oa-contact-name">吴丽丽</h4>  
                                    <span class="oa-contact-position mui-h6">理事长</span>  
                                </div>  
                                <p class="oa-contact-email mui-h6">  
                                    wulili@dh.cn  
                                </p>  
                            </div>  
                        </div>  
                    </div>  
                </li>  
            </ul>  
            </div>  
            <div id="tabbar-with-map" class="mui-control-content">  
                <div class="title">这是div模式选项卡中的第4个子页面,该页面展示一个常见的设置示例.</div>  
                <ul class="mui-table-view">  
                <li class="mui-table-view-cell">  
                    <a class="mui-navigate-right">  
                        新消息通知  
                    </a>  
                </li>  
                <li class="mui-table-view-cell">  
                    <a class="mui-navigate-right">  
                        隐私  
                    </a>  
                </li>  
                <li class="mui-table-view-cell">  
                    <a class="mui-navigate-right">  
                        通用  
                    </a>  
                </li>  
            </ul>  
            <ul class="mui-table-view" style="margin-top: 25px;">  
                <li class="mui-table-view-cell">  
                    <a class="mui-navigate-right">  
                        关于mui  
                    </a>  
                </li>  
            </ul>  
            <ul class="mui-table-view" style="margin-top: 25px;">  
                <li class="mui-table-view-cell">  
                    <a style="text-align: center;color: #FF3B30;">  
                        退出登录  
                    </a>  
                </li>  
            </ul>  
            </div>  
        </div>  

</body>  

</html>

用chrome的手机模式查看的。

2015-01-15 12:15 负责人:无 分享
已邀请:
DCloud_UNI_FXY

DCloud_UNI_FXY

下个版本会修复此问题

DCloud_UNI_CHB

DCloud_UNI_CHB

确认为mui产品bug,赠送楼主50积分,预计本周末发布mui 1.1.0版本,届时将解决该问题。

该问题目前已经被锁定, 无法添加新回复