简体   繁体   English

使用svg时,锚元素无法在EDGE上打开href

[英]Anchor element doesn't open the href on EDGE when svg is used

I have the following code: 我有以下代码:

<a target="_blank" href={this.props.FacebookUrl}>
  <svg className="icon svg-facebook">
     <use xlinkHref={'/Content/icons/sprite/icons-common.svg#facebook'} />
  </svg> 
</a>

Generated Code:


<a target="_blank" href="https://www.facebook.com/facebook" data-reactid=".dzu29bnjgg.0.0.0.2.0.1.0.0.0">
  <svg class="icon svg-facebook" data-reactid=".dzu29bnjgg.0.0.0.2.0.1.0.0.0.0">
    <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/Content/icons/sprite/icons-common.svg#facebook" data-reactid=".dzu29bnjgg.0.0.0.2.0.1.0.0.0.0.0">
    </use>
  </svg>
</a>

Clicking on the Anchor opens the Facebook Url besides on EDGE 单击锚点,然后在EDGE上打开Facebook Url

What's the problem? 有什么问题?

Try this. 尝试这个。 Give the svg the attribute focusable="false" and tell me if that fixes it. 给svg属性focusable="false"并告诉我是否可以解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM