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:
Devan Buggay
2025-09-18 00:36:55 -07:00
committed by Facebook GitHub Bot
parent 3e5838086f
commit 07b5802ee5
2 changed files with 13 additions and 0 deletions
@@ -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
@@ -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.