Skip to content

Commit b22d51f

Browse files
committed
Windows only
1 parent 92193cf commit b22d51f

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

src/Controls/src/Core/Platform/AlertManager/AlertManager.Android.cs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
using Android.Content;
77
using Android.Text;
88
using Android.Views;
9-
using Android.Views.InputMethods;
109
using Android.Widget;
1110
using AndroidX.AppCompat.Widget;
1211
using Microsoft.Maui.Controls.Internals;
1312
using static Android.Views.ViewGroup;
14-
using static Android.Widget.TextView;
1513
using AButton = Android.Widget.Button;
1614
using AppCompatActivity = AndroidX.AppCompat.App.AppCompatActivity;
1715
using AppCompatAlertDialog = AndroidX.AppCompat.App.AlertDialog;
@@ -277,10 +275,8 @@ void OnPromptRequested(IView sender, PromptArguments arguments)
277275
if (arguments.Keyboard == Keyboard.Numeric)
278276
editText.KeyListener = LocalizedDigitsKeyListener.Create(editText.InputType);
279277

280-
editText.EditorAction += OnEditorAction;
281-
282278
if (arguments.MaxLength > -1)
283-
editText.SetFilters([new InputFilterLengthFilter(arguments.MaxLength)]);
279+
editText.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(arguments.MaxLength) });
284280

285281
frameLayout.AddView(editText);
286282
alertDialog.SetView(frameLayout);
@@ -292,21 +288,6 @@ void OnPromptRequested(IView sender, PromptArguments arguments)
292288
alertDialog.Window.SetSoftInputMode(SoftInput.StateVisible);
293289
alertDialog.Show();
294290
editText.RequestFocus();
295-
296-
void OnEditorAction(object sender, EditorActionEventArgs e)
297-
{
298-
if (sender is not AppCompatEditText editText)
299-
{
300-
return;
301-
}
302-
303-
editText.EditorAction -= OnEditorAction;
304-
305-
if (e.ActionId == ImeAction.Done)
306-
{
307-
alertDialog.GetButton((int)DialogButtonType.Positive)?.PerformClick();
308-
}
309-
}
310291
}
311292

312293
void UpdateProgressBarVisibility(bool isBusy)

src/Controls/src/Core/Platform/AlertManager/AlertManager.iOS.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,6 @@ void PresentPrompt(Page sender, PromptArguments arguments)
136136
uiTextField.Text = arguments.InitialValue;
137137
uiTextField.ShouldChangeCharacters = (field, range, replacementString) => arguments.MaxLength <= -1 || field.Text.Length + replacementString.Length - range.Length <= arguments.MaxLength;
138138
uiTextField.ApplyKeyboard(arguments.Keyboard);
139-
uiTextField.ShouldReturn = _ =>
140-
{
141-
arguments.SetResult(alert.TextFields[0].Text);
142-
alert.DismissViewController(true, null);
143-
144-
return false;
145-
};
146139
});
147140

148141
var oldFrame = alert.View.Frame;

0 commit comments

Comments
 (0)