mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Update PointerEvents static method to reduce duplication
Summary: This diff updated `PointerEvents` enum to reduce duplication for null checks on pointer events string. Changelog: [Internal] Reviewed By: javache Differential Revision: D33717223 fbshipit-source-id: ff542a05240393416d85651ca08cd55136eb79a4
This commit is contained in:
1 parent
d6db5c5464
commit
67355f6c74
4 files changed
+8
-19
No files matched your search
@@ -29,7 +29,11 @@ public enum PointerEvents {
|
||||
;
|
||||
|
||||
public static PointerEvents parsePointerEvents(String pointerEventsStr) {
|
||||
return PointerEvents.valueOf(pointerEventsStr.toUpperCase(Locale.US).replace("-", "_"));
|
||||
if (pointerEventsStr == null) {
|
||||
return PointerEvents.AUTO;
|
||||
} else {
|
||||
return PointerEvents.valueOf(pointerEventsStr.toUpperCase(Locale.US).replace("-", "_"));
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean canBeTouchTarget(PointerEvents pointerEvents) {
|
||||
|
||||
Reference in new issue
Block a user