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

BUG: [Display(Prompt="...")] not working on textarea elements. #4903

Closed
Bartmax opened this issue Jun 24, 2016 · 4 comments
Closed

BUG: [Display(Prompt="...")] not working on textarea elements. #4903

Bartmax opened this issue Jun 24, 2016 · 4 comments

Comments

@Bartmax
Copy link

Bartmax commented Jun 24, 2016

Model:

[DataType(DataType.MultilineText)]
[Display(Prompt =nameof(Issue))]
public string Issue { get; set; }

Using input:
placeholder attribute render correctly

<input asp-for="Issue" class="form-control" />

<input class="form-control" 
       type="text" 
       id="Issue" 
       name="Issue" 
       placeholder="Issue" 
       value=""
       data-val="" data-val-required="The Issue field is required."  />

Using textarea:
placeholder attribute missing from output

<textarea asp-for="Issue" class="form-control"></textarea>

<textarea class="form-control" 
          data-val="true" 
          data-val-required="The Issue field is required." 
          id="Issue" 
          name="Issue">
</textarea>

image

Expected:
Both textarea and input should have the placeholder attribute populated.

@dougbu
Copy link
Member

dougbu commented Jun 24, 2016

A small feature gap. We implemented support for placeholder only in <input> elements i.e.DefaultHtmlGenerator.GenerateTextArea() lacks code we have in DefaultHtmlGenerator.GenerateInput().

@Haplois
Copy link
Contributor

Haplois commented Jun 24, 2016

I implemented that, and pretty sure it works. But solution won't compile now, so I'm not sure. As soon as I can compile and test I'll send a pull request.

@Eilon
Copy link
Member

Eilon commented Jun 29, 2016

@dougbu assigning to you for PR #4907.

dougbu pushed a commit that referenced this issue Jun 29, 2016
Fix for #4903.
- `HtmlHelperTextAreaTest` added
- fix up `HtmlHelperTextBoxTest`
@dougbu
Copy link
Member

dougbu commented Jun 29, 2016

a852352

@dougbu dougbu closed this as completed Jun 29, 2016
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

4 participants