Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bind can be improved for <textarea> #16286

Closed
torhovland opened this issue Mar 29, 2018 · 5 comments
Closed

bind can be improved for <textarea> #16286

torhovland opened this issue Mar 29, 2018 · 5 comments
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@torhovland
Copy link

I have to do this in order to get the initial value loaded into the textarea:

<textarea @bind(myvar)>@myvar</textarea>

It would be nicer and more consistent with <input> if this would work the same way:

<textarea @bind(myvar)></textarea>
@RyoukoKonpaku
Copy link
Contributor

It should be fixed I guess once PR dotnet/blazor#406 is merged as they're revamping the bind system to be more flexible and powerful.

@SteveSandersonMS
Copy link
Member

SteveSandersonMS commented Mar 29, 2018

I think that regardless of dotnet/blazor#406 we'll still need to make a tweak in BrowserRenderer.ts in the tryApplyValueProperty function so that it understands that textarea requires special handling for value (equivalent to how it already does for input and select).

This should be a fairly easy tweak (and doesn't need to wait for dotnet/blazor#406) if anyone's interested in submitting a PR :)

@SteveSandersonMS
Copy link
Member

In fact it's super trivial: just add case 'TEXTAREA': right under case 'SELECT':. That should do it.

Then it needs an E2E test in BindTest.cs and we're done 🥇

@RyoukoKonpaku
Copy link
Contributor

@SteveSandersonMS Sounds easy enough xD can I give it a shot?

RyoukoKonpaku referenced this issue in RyoukoKonpaku/Blazor Mar 29, 2018
RyoukoKonpaku referenced this issue in RyoukoKonpaku/Blazor Mar 29, 2018
SteveSandersonMS referenced this issue in dotnet/blazor Mar 30, 2018
* Text Area Bind Fix for issue #434

* Correct Typo/Mispelling on test method name.
@SteveSandersonMS
Copy link
Member

Resolved in dotnet/blazor#439

SteveSandersonMS referenced this issue in SteveSandersonMS/BlazorMigration Nov 27, 2018
* Text Area Bind Fix for issue #434

* Correct Typo/Mispelling on test method name.
@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/blazor Oct 27, 2019
@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Oct 27, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

4 participants