@@ -21,7 +21,6 @@ class ReactTextInputManager : BaseViewManager<ReactTextBox, ReactTextInputShadow
21
21
internal const int BlurTextInput = 2 ;
22
22
23
23
private bool _onSelectionChange ;
24
- private bool ? _blurOnSubmit ;
25
24
26
25
internal static readonly Color DefaultTextBoxBorder = Color . FromArgb ( 255 , 122 , 122 , 122 ) ;
27
26
internal static readonly Color DefaultPlaceholderTextColor = Color . FromArgb ( 255 , 0 , 0 , 0 ) ;
@@ -332,10 +331,6 @@ public void SetMultiline(ReactTextBox view, bool multiline)
332
331
{
333
332
view . AcceptsReturn = multiline ;
334
333
view . TextWrapping = multiline ? TextWrapping . Wrap : TextWrapping . NoWrap ;
335
- if ( _blurOnSubmit == null )
336
- {
337
- _blurOnSubmit = ! multiline ;
338
- }
339
334
}
340
335
341
336
/// <summary>
@@ -391,12 +386,6 @@ public void SetSelectTextOnFocus(ReactTextBox view, bool selectTextOnFocus)
391
386
view . SelectTextOnFocus = selectTextOnFocus ;
392
387
}
393
388
394
- [ ReactProp ( "blurOnSubmit" ) ]
395
- public void SetBlurOnSubmit ( ReactTextBox view , bool blurOnSubmit )
396
- {
397
- _blurOnSubmit = blurOnSubmit ;
398
- }
399
-
400
389
/// <summary>
401
390
/// Create the shadow node instance.
402
391
/// </summary>
@@ -488,7 +477,7 @@ public override void UpdateExtraData(ReactTextBox view, object extraData)
488
477
public override void OnDropViewInstance ( ThemedReactContext reactContext , ReactTextBox view )
489
478
{
490
479
base . OnDropViewInstance ( reactContext , view ) ;
491
- view . PreviewKeyDown -= OnKeyDown ;
480
+ view . KeyDown -= OnKeyDown ;
492
481
view . LostFocus -= OnLostFocus ;
493
482
view . GotFocus -= OnGotFocus ;
494
483
view . TextChanged -= OnTextChanged ;
@@ -526,7 +515,7 @@ protected override void AddEventEmitters(ThemedReactContext reactContext, ReactT
526
515
view . TextChanged += OnTextChanged ;
527
516
view . GotFocus += OnGotFocus ;
528
517
view . LostFocus += OnLostFocus ;
529
- view . PreviewKeyDown += OnKeyDown ;
518
+ view . KeyDown += OnKeyDown ;
530
519
}
531
520
532
521
private void OnTextChanged ( object sender , TextChangedEventArgs e )
@@ -572,20 +561,12 @@ private void OnLostFocus(object sender, RoutedEventArgs e)
572
561
573
562
private void OnKeyDown ( object sender , KeyEventArgs e )
574
563
{
575
- var shiftModifier = ( Keyboard . Modifiers & ModifierKeys . Shift ) == ModifierKeys . Shift ;
576
- var controlModifier = ( Keyboard . Modifiers & ModifierKeys . Control ) == ModifierKeys . Control ;
577
- var blurOnSubmit = ( _blurOnSubmit . HasValue && _blurOnSubmit . Value ) ;
578
-
579
- if ( e . Key == Key . Enter && ! shiftModifier )
564
+ if ( e . Key == Key . Enter )
580
565
{
581
566
var textBox = ( ReactTextBox ) sender ;
582
- if ( ! textBox . AcceptsReturn || blurOnSubmit || controlModifier )
567
+ if ( ! textBox . AcceptsReturn )
583
568
{
584
569
e . Handled = true ;
585
- if ( blurOnSubmit )
586
- {
587
- Keyboard . ClearFocus ( ) ;
588
- }
589
570
textBox . GetReactContext ( )
590
571
. GetNativeModule < UIManagerModule > ( )
591
572
. EventDispatcher
0 commit comments