Skip to content

Support option child element for abp-select tag #8781

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

Merged
merged 2 commits into from
Apr 26, 2021

Conversation

acjh
Copy link
Contributor

@acjh acjh commented Apr 25, 2021

Resolves https://stackoverflow.com/questions/67172053/empty-items-for-abp-select

Changes:

  1. Set selectTagHelperOutput.Content to childContent from output in AbpSelectTagHelperService.GetSelectTagAsync:
  var selectTagHelperOutput = await selectTagHelper.ProcessAndGetOutputAsync(GetInputAttributes(context, output), context, "select", TagMode.StartTagAndEndTag);

+ selectTagHelperOutput.Content.SetHtmlContent(childContent);
  1. Add [OutputElementHint("select")] on AbpSelectTagHelper so that <option> child element is allowed at design time.
    Otherwise, we get the warning Element 'option' cannot be nested inside element 'div'. from Razor in .cshtml files.
    You may need to restart Visual Studio for this to take effect.

  2. Update the demo in FormElements.cshtml for https://bootstrap-taghelpers.abp.io/Components/FormElements.
    The demo is linked on https://docs.abp.io/en/abp/latest/UI/AspNetCore/Tag-Helpers/Form-elements.

Reference: https://docs.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/authoring?view=aspnetcore-5.0#inspect-and-retrieve-child-content

@acjh acjh changed the title Patch 5 Support option child element for abp-select tag Apr 25, 2021
@maliming maliming added this to the 4.4-preview milestone Apr 26, 2021
@maliming maliming self-requested a review April 26, 2021 03:16
@maliming maliming merged commit 1fb7d2e into abpframework:dev Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants