mirror of
https://github.com/stablyai/orca.git
synced 2026-10-20 16:03:20 +00:00
47 lines
2.2 KiB
Diff
47 lines
2.2 KiB
Diff
diff --git a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm
|
|
--- a/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm
|
|
+++ b/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm
|
|
@@ -701,7 +701,8 @@
|
|
- (TextInputEventEmitter::Metrics)_textInputMetrics
|
|
{
|
|
return {
|
|
.text = RCTStringFromNSString(_backedTextInputView.attributedText.string),
|
|
+ .isComposing = _backedTextInputView.markedTextRange != nil,
|
|
.selectionRange = [self _selectionRange],
|
|
.eventCount = static_cast<int>(_mostRecentEventCount),
|
|
.contentOffset = RCTPointFromCGPoint(_backedTextInputView.contentOffset),
|
|
diff --git a/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.cpp b/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.cpp
|
|
--- a/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.cpp
|
|
+++ b/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.cpp
|
|
@@ -20,6 +20,10 @@ static jsi::Value textInputMetricsPayload(
|
|
"text",
|
|
jsi::String::createFromUtf8(runtime, textInputMetrics.text));
|
|
|
|
+ if (textInputMetrics.isComposing.has_value()) {
|
|
+ payload.setProperty(runtime, "isComposing", *textInputMetrics.isComposing);
|
|
+ }
|
|
+
|
|
payload.setProperty(runtime, "target", textInputMetrics.target);
|
|
|
|
payload.setProperty(runtime, "eventCount", textInputMetrics.eventCount);
|
|
diff --git a/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.h b/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.h
|
|
--- a/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.h
|
|
+++ b/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.h
|
|
@@ -6,6 +6,8 @@
|
|
|
|
#pragma once
|
|
|
|
+#include <optional>
|
|
+
|
|
#include <react/renderer/attributedstring/AttributedString.h>
|
|
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
|
|
@@ -18,6 +20,7 @@ class TextInputEventEmitter : public ViewEventEmitter {
|
|
|
|
struct Metrics {
|
|
std::string text;
|
|
+ std::optional<bool> isComposing;
|
|
AttributedString::Range selectionRange;
|
|
// ScrollView-like metrics
|
|
Size contentSize;
|