[英]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.