Vue: window resize后导致click事件无效

Created on 30 Jun 2017  ·  4Comments  ·  Source: vuejs/vue

Version

2.3.3

Reproduction link

https://jsfiddle.net/50wL7mdz/43916/

Steps to reproduce

<popup v-model="dietPicker.show" class="diet-picker">
      <div class="search" ref="searchContainer" v-if="dietPicker.show">
        <input type="text" v-model="dietSearchInput" ref="dietSearch" class="r1b"/>
        <button @click="foodSearch">搜索</button>
      </div>
      <p class="s-loading" v-if="dietCheckList.length == 0" style="text-align: center;">正在加载食物列表...</p>
      <ul class="picker-list r1b" v-if="dietCheckList.length > 0" ref="chooseDietUl">
        <li v-for="diet in dietCheckList" @click="chooseDiet(diet)">
          <div>
            <img :src="diet.image"/><span>{{ diet.name }}</span>
          </div>
        </li>
      </ul>
    </popup>

点击button会弹出一个popup ,这是一个遮罩层,当遮罩层弹出来dietCheckList去后台拿数据,拿到数据后ul列表展示出来

What is expected?

点击input后ul中的li可以调用chooseDiet方法

What is actually happening?

在ios10.2.1上面当点击input后弹出手机的键盘后,li的click事件无效,点击键盘的收起按钮后,页面恢复后li的click事件依然无效


这是必现的问题,在最新版的ios10.3上面不会有任何问题,android和最新版chrome也不会有问题,jsfiddle上不一定可以复现,类似于这个:https://stackoverflow.com/questions/41746739/vue-js-directive-does-not-work-on-injected-element?answertab=active#tab-top

Most helpful comment

你需要把真正有问题的代码发出来,提供一个不能重现的jsfiddle别人帮不了你。

PS:寻求帮助的话你应该去https://forum.vuejs.org/c/chinese,而不是提issue

All 4 comments

补充下:在ios 10.2.1,当点击事件无效的时候ul可以正常滑动,我监听了ul的touchmove事件后,li的click事件又恢复了,监听touchstart事件,li的click事件还是无效

What makes you think this is caused by Vue?
On Fri, Jun 30, 2017 at 4:54 PM wangbagang notifications@github.com wrote:

补充下:在ios
10.2.1,当点击事件无效的时候ul可以正常滑动,我监听了ul的touchmove事件后,li的click事件又恢复了,监听touchstart事件,li的click事件还是无效


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/vuejs/vue/issues/6001#issuecomment-312213796, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAefXvAkbbQH7dI7Hyvay54QAU5GbVkNks5sJLezgaJpZM4OKUGx
.

尤大大您好,你问确实是,这个问题不一定是因为vue引起的,我也实在想不出,找不出什么原因导致的,还望迷津。

你需要把真正有问题的代码发出来,提供一个不能重现的jsfiddle别人帮不了你。

PS:寻求帮助的话你应该去https://forum.vuejs.org/c/chinese,而不是提issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rpkilby picture rpkilby  ·  50Comments

chrisvfritz picture chrisvfritz  ·  46Comments

ferry77 picture ferry77  ·  67Comments

ShuvoHabib picture ShuvoHabib  ·  40Comments

asiFarran picture asiFarran  ·  34Comments