-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Transition SelectTagHelper
and OptionTagHelper
to use context.Items
.
#3392
Conversation
/cc @dougbu |
@@ -54,7 +54,7 @@ public override int Order | |||
|
|||
/// <inheritdoc /> | |||
/// <remarks> | |||
/// Does nothing unless <see cref="FormContext.FormData"/> contains a | |||
/// Does nothing unless <see cref="TagHelperContext.Items"/> contains a | |||
/// <see cref="SelectTagHelper.SelectedValuesFormDataKey"/> entry and that entry is a non-empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throw SelectTagHelper.SelectedValuesFormDataKey
away -- far away. This is an inefficient pattern that Items
was designed to avoid. Instead use typeof(SelectTagHelper)
.
⌚ |
Updated. |
@@ -131,7 +121,7 @@ public override void Process(TagHelperContext context, TagHelperOutput output) | |||
|
|||
// Whether or not (not being highly unlikely) we generate anything, could update contained <option/> | |||
// elements. Provide selected values for <option/> tag helpers. They'll run next. | |||
ViewContext.FormContext.FormData[SelectedValuesFormDataKey] = currentValues; | |||
context.Items[typeof(SelectTagHelper)] = currentValues; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to move to new Init()
method as part of your reaction PR. Could you rebase that branch on top of this one? Or is that almost ready to get in first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now Init()
s in, this should be there.
⌚ |
f99e45f
to
96421a5
Compare
Updated. |
/// Thrown if <see cref="Items"/> is non-<c>null</c> but <see cref="For"/> is <c>null</c>. | ||
/// </exception> | ||
public override void Process(TagHelperContext context, TagHelperOutput output) | ||
public override void Init(TagHelperContext context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// <inheritdoc />
but may want to wait for Coherence to catch up since we can't confirm MVC builds at the moment. |
96421a5
to
24b16f0
Compare
…ems`. - Added functional tests to validate data created from a `SelectTagHelper` does not impact following `<select>` tags. - Also moved the new `SelectTagHelper` communication flow into `TagHelper.Init`. #3347
24b16f0
to
911dfc5
Compare
SelectTagHelper
does not impact following<select>
tags.TagHelper and non-TagHelper select tags in a form don't work well together. #3347