Replies: 3 comments
-
There is an issue with submission icw TextField. Search the issues for more information. |
Beta Was this translation helpful? Give feedback.
0 replies
-
The issues Vincent is referring to are #1050, #1085 and #2726 |
Beta Was this translation helpful? Give feedback.
0 replies
-
I've accidentally found a workaround. private void HandleInputChange(ChangeEventArgs e)
{
// Update value for immediate validation:
Content.Value = e.Value?.ToString() ?? string.Empty;
} I don't only get validation during typing, but when now hitting the Enter-key once the value is submitted and the dialog is closed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a very simple webpage using Blazor (v8) and FluentUI (v4.10.2).
It has an
Add
button and a data grid.The first column of each row of the data grid has an
Edit
button.I want to use the same dialog for the Add and Edit action.
The dialog has 1 textbox and a close and cancel button.
When the user presses the
Escape
key the cancel button should be triggered and the dialog closed.When the user presses the
Enter
key the value of the textbox should be returned to the caller and the dialog should be closed.With Googling and reading the FluentUI documentation the dialog will close when hit
Escape
. Also inEdit
mode, hittingEnter
works but inAdd
mode I need to press theEnter
key twice.Also my code feels a bit hacky, so I wonder if I'm doing it right or not.
Here's the code to open the dialog:
I use similar as the Edit option for the Add option, except the
SimpleDialogData
is empty.This is the code for the SimpleDialog:
Especially the
_editContext.NotifyFieldChanged(FieldIdentifier.Create(() => Content.Value));
feels a bit hacky and I need to use it 3 times. I use it because else in Edit mode the changed value wasn't returned to the caller because it wasn't updated yet.Please advice.
Beta Was this translation helpful? Give feedback.
All reactions