ga-wdi-boston / ember-routing-dynamic

Routing for resources; Route objects; dynamic segments.
Other
0 stars 79 forks source link

Remove `tagName` option from `#link-to`? #13

Closed GA-MEB closed 7 years ago

GA-MEB commented 8 years ago

@jrhorn424 argues that you shouldn't use it because "a link should always be a link".

I think there some situations in which that is not desirable - for instance, when dealing with a framework like Bootstrap. #link-to will only add an .active class to the specific element it creates, so if your links are items in a list and you want to highlight the list item that you've selected, the only way that this can be done is using tagName='li'

(See https://github.com/emberjs/ember.js/issues/1822)

jrhorn424 commented 8 years ago

That's true, but for most use cases I'm aware of in bootstrap, active is only applied to part of the navbar or a button, or some other element (like a list group) that is styled in a way which indicates something is clickable.

Do we want to teach this subtlety during this lesson or is it something that should be mentioned during projects when it comes up?

raq929 commented 7 years ago

@jrhorn424 How did this go in the last cohort? Is it something I should change for 015?

raq929 commented 7 years ago

After talking with @jrhorn424, we've decided to leave the link-to without a tagName and wrap the whole thing in an <li>. This avoids problems like changing the css to indicate it's a link, and changing the cursor on hover.