Skip to content

Commit 2f2a38b

Browse files
authored
docs(dialog): Include an example of configuring the default input text in a prompt dialog. (#1514)
1 parent 5250638 commit 2f2a38b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/dialog/predefined.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ The prompt dialog returns a `string` that the user enters when they press `OK`,
114114
115115
<TelerikButton OnClick="@ShowPrompt">Show Prompt</TelerikButton>
116116
<TelerikButton OnClick="@ShowPromptWithTitle">Show Prompt with Custom Title</TelerikButton>
117+
<TelerikButton OnClick="@ShowPromptWithTitleAndDefaultText">Show Prompt with Title and Default Input Text</TelerikButton>
117118
118119
@code {
119120
[CascadingParameter]
@@ -139,6 +140,13 @@ The prompt dialog returns a `string` that the user enters when they press `OK`,
139140
140141
Console.WriteLine($"The user answer: {userInput}");
141142
}
143+
144+
async Task ShowPromptWithTitleAndDefaultText()
145+
{
146+
string userInput = await Dialogs.PromptAsync("Enter answer:", "Input needed", "Default Text");
147+
148+
Console.WriteLine($"The user answer: {userInput}");
149+
}
142150
}
143151
````
144152

0 commit comments

Comments
 (0)