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.
Comments
Comment #2
keeganstreet commentedComment #3
keeganstreet commentedAdded patch for 8.4.x which includes es6.js file.
Comment #6
gargsuchi commentedReroll attached against 8.5.x.
Comment #8
chop commentedTime to test against latest dev branch.
Comment #12
gge commentedWith this patch blocks added using layout builder can't be edited anymore...
Comment #14
nwom commentedSetting to NW due to the comment in #12.
Comment #15
gro commentedRe-rolled patch for Core 8.9
Comment #16
seanrAdded a patch against 9.2.x.
Comment #18
dhirendra.mishra commentedRe-rolled it against 9.3.x and fixed on white-space issue which you can see in attached screenshot.
Comment #20
larowlanContextual links are controlled from your template.
If your template is outputting a wrapping link, you can simply choose not to output the title_suffix variable which renders the contextual link.