forked from microsoft/react-native-macos
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix onFocus/onBlur event bubbling (microsoft#506)
* Update scripts to publish react-native-macos-init * Clean up merge markers * Restored ios:macos RNTester parity except for InputAccessoryView. * Revert "Restored ios:macos RNTester parity except for InputAccessoryView." This reverts commit 5a67ae0. * Remove unnecessary android builds and tar file upload. * Fix onFocus/onBlur View events to properly bubble. * The Text component can also be selectable={true} and needs the same focus/blur event triggering as View. Co-authored-by: React-Native Bot <53619745+rnbot@users.noreply.github.com>
- Loading branch information
Showing
16 changed files
with
237 additions
and
32 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import <React/RCTComponentEvent.h> | ||
|
||
/** | ||
* Represents a focus change event meaning that a view that can become first responder has become or resigned being first responder. | ||
*/ | ||
@interface RCTFocusChangeEvent : RCTComponentEvent | ||
|
||
+ (instancetype)focusEventWithReactTag:(NSNumber *)reactTag; | ||
+ (instancetype)blurEventWithReactTag:(NSNumber *)reactTag; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#import "RCTFocusChangeEvent.h" | ||
|
||
#import "RCTAssert.h" | ||
|
||
@implementation RCTFocusChangeEvent | ||
|
||
+ (instancetype)focusEventWithReactTag:(NSNumber *)reactTag | ||
{ | ||
RCTFocusChangeEvent *event = [[self alloc] initWithName:@"focus" | ||
viewTag:reactTag | ||
body:@{}]; | ||
return event; | ||
} | ||
|
||
+ (instancetype)blurEventWithReactTag:(NSNumber *)reactTag | ||
{ | ||
RCTFocusChangeEvent *event = [[self alloc] initWithName:@"blur" | ||
viewTag:reactTag | ||
body:@{}]; | ||
return event; | ||
} | ||
|
||
@end |
Oops, something went wrong.