-
Notifications
You must be signed in to change notification settings - Fork 737
Labels
Description
- I have searched the existing issues
Describe the bug
When calling PromptInputsAsync with ShowDismiss = false in InputsDialogInteractionOptions, the dialog still displays a dismiss button. This seems to ignore the ShowDismiss parameter.
Expected Behavior
When the PromptInputsAsync dialog is shown with ShowDismiss = false, the dialog should NOT display a dismiss button.
Steps To Reproduce
Use the following code to create a hosted service with an interaction prompt:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#pragma warning disable ASPIREINTERACTION001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
var builder = DistributedApplication.CreateBuilder(args);
builder.Services.AddHostedService<WebStoryHostedService>();
builder.Build().Run();
internal sealed class WebStoryHostedService(IInteractionService interactionService) : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
var result = await interactionService.PromptMessageBarAsync(
"A title",
"a message",
new MessageBarInteractionOptions
{
PrimaryButtonText = "Enter values"
},
cancellationToken: stoppingToken);
if (result.Data)
{
await interactionService.PromptInputsAsync(
"Input",
"Please enter some input",
[
new InteractionInput { InputType = InputType.Text, Label = "One", },
new InteractionInput { InputType = InputType.Text, Label = "Two", },
],
new InputsDialogInteractionOptions
{
ShowDismiss = false
},
stoppingToken);
}
}
}
cc @JamesNK