Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 301123

Contextual links should not be added inside another link

$
0
0

Sometimes we design a teaser view mode to wrap the entire content in an anchor element. For example:

<a href="/node/1">
  <h2>Title</h2>
  <div>Short description</div>
  <img src="thumbnail.jpg" />
</a>

Contextual links inserts additional links inside this anchor. It is not valid HTML to have anchors inside anchors, and the contextual links do not work. For example:

<a href="/node/1">
  <h2>Title</h2>
  <div>Short description</div>
  <img src="thumbnail.jpg" />
  <button>Open  configuration options</button>
  <ul class="contextual-links">
    <li><a href="#">Quick edit</a></li>
    <li><a href="#">Edit</a></li>
    <li><a href="#">Delete</a></li>
  </ul>
</a>

I think the expected behaviour is that the contextual trigger and contextual links are not injected into the DOM if the contextual region is a descendent of an anchor.


Viewing all articles
Browse latest Browse all 301123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>