diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/InputTagHelper.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/InputTagHelper.cs
index d386020418..48a457e495 100644
--- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/InputTagHelper.cs
+++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/InputTagHelper.cs
@@ -230,6 +230,30 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
}
}
+ ///
+ /// Gets an <input> element's "type" attribute value based on the given
+ /// or .
+ ///
+ /// The to use.
+ /// When this method returns, contains the string, often the name of a
+ /// base class, used to determine this method's return value.
+ /// An <input> element's "type" attribute value.
+ protected string GetInputType(ModelExplorer modelExplorer, out string inputTypeHint)
+ {
+ foreach (var hint in GetInputTypeHints(modelExplorer))
+ {
+ string inputType;
+ if (_defaultInputTypes.TryGetValue(hint, out inputType))
+ {
+ inputTypeHint = hint;
+ return inputType;
+ }
+ }
+
+ inputTypeHint = InputType.Text.ToString().ToLowerInvariant();
+ return inputTypeHint;
+ }
+
private void GenerateCheckBox(ModelExplorer modelExplorer, TagHelperOutput output)
{
if (typeof(bool) != modelExplorer.ModelType)
@@ -371,22 +395,6 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
return format;
}
- private string GetInputType(ModelExplorer modelExplorer, out string inputTypeHint)
- {
- foreach (var hint in GetInputTypeHints(modelExplorer))
- {
- string inputType;
- if (_defaultInputTypes.TryGetValue(hint, out inputType))
- {
- inputTypeHint = hint;
- return inputType;
- }
- }
-
- inputTypeHint = InputType.Text.ToString().ToLowerInvariant();
- return inputTypeHint;
- }
-
// A variant of TemplateRenderer.GetViewNames(). Main change relates to bool? handling.
private static IEnumerable GetInputTypeHints(ModelExplorer modelExplorer)
{