justinfagnani / route

A client + server routing library for Dart
BSD 3-Clause "New" or "Revised" License
114 stars 40 forks source link

Nested tags inside anchors break the global click listener. #23

Open marcog83 opened 11 years ago

marcog83 commented 11 years ago

Hi, i tried the example. it works. but if I add an tag inside ,

"File not found: /one" message appear :(

This is what I changed

 <a href="/one" title="Section One">  <img src="http://digital-photography-school.com/wp-content/uploads/2013/03/Acorn256.png">  </a>
 <a href="/two" title="Section Two">Two</a> 

thanks marco

pavelgj commented 11 years ago

It looks like the current implementation of the anchor click interceptor does not support nested elements inside the a tag. A couple of workaround options:

  1. Use CSS background instead of nested image.
  2. Add a custom click listener on the img tag that first does e.preventDefault(); and then router.handle(hrefValueFromTheLink).
justinfagnani commented 11 years ago

Reopening, since this is still an issue.