Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Transition MVC TagHelpers to use TargetElementAttributes attribute targeting. #2195

Closed
NTaylorMullen opened this issue Mar 18, 2015 · 6 comments

Comments

@NTaylorMullen
Copy link
Contributor

Now that TagHelpers can target attributes we should transition our existing TagHelpers to utilize this new "required" attributes functionality.

One example: ValidationSummaryTagHelper shouldn't target "div" elements then no-op if the attribute doesn't exist: It should target the asp-validation-summary attribute on any HTML element.

This should also enable us to no longer have ambiguity between "should I be a tag helper" for all of our tag helpers.

@dougbu
Copy link
Member

dougbu commented Mar 18, 2015

it's likely views would perform better if tag helpers were not created only to no-op. however we should measure things to confirm this is worthwhile since the MVC tag helpers are doing simple checks that work today.

specifically:

ValidationSummaryTagHelper shouldn't target "div" elements then no-op if the attribute doesn't exist: It should target the asp-validation-summary attribute on any HTML element.

"any" is too broad. we likely want to target <div> and <span> and that's about it. in any case, we should strive to preserve the chosen behaviour and limit work on this issue to the implementation choice. deal with reevaluating the behaviours separately.

This should also enable us to no longer have ambiguity between "should I be a tag helper" ...

could you clarify this statement? is this another point about changing the current MVC tag helper behaviours?

@danroth27 danroth27 added this to the 6.0.0 milestone Mar 18, 2015
@danroth27
Copy link
Member

@DamianEdwards Let us know if you think we need to pull this back into the current milestone.

@DamianEdwards
Copy link
Member

We should do this now

@NTaylorMullen
Copy link
Contributor Author

@dougbu The ambiguity bit I mentioned will drastically improve TagHelper tooling. For instance, today in the pre-bits for TagHelper tooling every div tag is highlighted because of the validation summary maybe being a TagHelper on div elements. Same thing goes for all other TagHelpers.

@DamianEdwards DamianEdwards modified the milestones: 6.0.0-rc1, 6.0.0 Mar 18, 2015
@dougbu
Copy link
Member

dougbu commented Mar 18, 2015

@NTaylorMullen thanks, that was much clearer

@ajaybhargavb
Copy link
Contributor

Part 1 - bfdeda7
Part 2 - e205890
Part 3 - fd5e07d

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants