Files
android/src/iOS.Core/Effects/NoEmojiKeyboardEffect.cs
aj-rosado 3d9555d420 [PS-1009] Changed keyboard on Passphrase generator to not allow emojis (#2038)
* PS-1009 Added effect to Entry that doesn't allow keyboard with emojis on passphrase separator

* PS-1009 Removed unnecessary ImeOptions setting from NoEmojiKeyboardEffect
Improved code

* PS-1009 Removed unnecessary null validation on Android's NoEmojiKeyboardEffect

Co-authored-by: Federico Maccaroni <fedemkr@gmail.com>
2022-08-16 18:54:28 +01:00

26 lines
603 B
C#

using System;
using Bit.iOS.Core.Effects;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportEffect(typeof(NoEmojiKeyboardEffect), nameof(NoEmojiKeyboardEffect))]
namespace Bit.iOS.Core.Effects
{
public class NoEmojiKeyboardEffect : PlatformEffect
{
protected override void OnAttached()
{
if (Element != null && Control is UITextField textField)
{
textField.KeyboardType = UIKeyboardType.ASCIICapable;
}
}
protected override void OnDetached()
{
}
}
}