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

Add InputTagHelper #1359

Merged
merged 1 commit into from
Oct 17, 2014
Merged

Add InputTagHelper #1359

merged 1 commit into from
Oct 17, 2014

Conversation

dougbu
Copy link
Contributor

@dougbu dougbu commented Oct 15, 2014

[ContentBehavior(ContentBehavior.Replace)]
public class InputTagHelper : TagHelper
{
private readonly Dictionary<string, string> _defaultInputTypes =

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason this can't be static?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see, this then ties into my q about extensibility below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. I also convinced myself any public configuration points (this isn't ideally a protected extensibility point) should be done when / if we plumb MvcOptions into HtmlHelper and our various ITagHelper implementations e.g. ViewContext.ClientValidationEnabled, ViewContext.Html5DateRenderingMode, DefaultHtmlGenerator.IdAttributeDotReplacement, TemplateRenderer._defaultDisplayActions, TemplateRenderer._defaultEditorActions, and this should get defaults or additions from MvcOptions.

@NTaylorMullen
Copy link

🐃

@dougbu dougbu force-pushed the TagHelpersFeature branch from 1cf6935 to 3a04e99 Compare October 16, 2014 17:47
@dougbu dougbu force-pushed the taghelper.input.1245 branch from ad096f7 to febd5c4 Compare October 16, 2014 21:51
@dougbu dougbu changed the title [Design] Add InputTagHelper Add InputTagHelper Oct 16, 2014
@dougbu
Copy link
Contributor Author

dougbu commented Oct 16, 2014

/// attribute to that formatted <see cref="string"/>.
/// </summary>
/// <remarks>
/// Used only if <see cref="Value "/> is <c>null</c> and <see cref="Process"/> calls

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Referencing process can be misleading because there's also ProcessAsync. Maybe ...and <see cref="InputTypeName" /> is not explicit or unknown. Feel free to correct my failnglish 😄, I tried !

@NTaylorMullen
Copy link

🐃

@dougbu dougbu force-pushed the TagHelpersFeature branch from b4b01ff to f8b0249 Compare October 17, 2014 05:18
@dougbu dougbu force-pushed the taghelper.input.1245 branch from febd5c4 to d5d5f7f Compare October 17, 2014 05:56
@dougbu
Copy link
Contributor Author

dougbu commented Oct 17, 2014

rebased and updated
/cc @NTaylorMullen

if (tagBuilder != null)
{
// This TagBuilder contains the one <input/> element of interest. Since this is not the "checkbox"
// special -case, output is a self-closing element and can merge the TagBuilder in directly.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: special-case

@NTaylorMullen
Copy link

:shipit:

- also make `TagHelperOutputExtensions.MergeAttributes()` case-insensitive

nits:
- deliniate attribute names in all resource strings
- update validation messages in TagHelperSample.Web
@dougbu dougbu force-pushed the taghelper.input.1245 branch from d5d5f7f to 012e03e Compare October 17, 2014 06:34
@dougbu dougbu merged commit 012e03e into TagHelpersFeature Oct 17, 2014
@dougbu dougbu deleted the taghelper.input.1245 branch October 17, 2014 06:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants