簡體   English   中英

單擊鐵選擇器中的元素時,防止鐵選擇被觸發

[英]Prevent iron-select to be fired when click on element in iron-selector

我試圖在iron-selector內點擊一個元素而不觸發iron-select事件。

<iron-selector selected="{{selected}}">
   .... lot of content.
   <a on-tap="_save">Save</a>
</iron-selector>

我希望在除<a></a>之外的所有內容上觸發iron-select事件。

我嘗試使用preventDefault但這不起作用。
我無法將<a></a>移出iron-selector
有任何想法嗎? 非常感謝幫助。

您可以使用stopPropagation 這將防止事件冒泡到父元素。

event.stopPropagation()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM