mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
focus/blur event emission (#53826)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53826 Wires up focus/blur events to the base event emitter, gated by enabledImperativeFocus feature flag. https://docs.google.com/document/d/1L4ViBnXq5hw858VoecZPmJE2llOB97Tjs2VtJ7RHlNI/edit?tab=t.0 Changelog: [Internal] Reviewed By: rozele Differential Revision: D82146275 fbshipit-source-id: 4b7bb1336f74bb0de2d7ecf0737dd63067bd558f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3e5838086f
commit
07b5802ee5
+9
@@ -112,4 +112,13 @@ void BaseViewEventEmitter::onLayout(const LayoutMetrics& layoutMetrics) const {
|
||||
});
|
||||
}
|
||||
|
||||
#pragma mark - Focus
|
||||
void BaseViewEventEmitter::onFocus() const {
|
||||
dispatchEvent("focus");
|
||||
}
|
||||
|
||||
void BaseViewEventEmitter::onBlur() const {
|
||||
dispatchEvent("blur");
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
+4
@@ -32,6 +32,10 @@ class BaseViewEventEmitter : public TouchEventEmitter {
|
||||
|
||||
void onLayout(const LayoutMetrics& layoutMetrics) const;
|
||||
|
||||
#pragma mark - Focus
|
||||
void onFocus() const;
|
||||
void onBlur() const;
|
||||
|
||||
private:
|
||||
/*
|
||||
* Contains the most recent `frame` and a `mutex` protecting access to it.
|
||||
|
||||
Reference in New Issue
Block a user