Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import com.facebook.react.uimanager.StateWrapper
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.ViewDefaults
import com.facebook.react.uimanager.ViewManagerDelegate
import com.facebook.react.uimanager.ViewProps
import com.facebook.react.uimanager.annotations.ReactProp
import com.facebook.react.viewmanagers.EnrichedTextInputViewManagerDelegate
import com.facebook.react.viewmanagers.EnrichedTextInputViewManagerInterface
Expand Down Expand Up @@ -132,7 +131,7 @@ class EnrichedTextInputViewManager : SimpleViewManager<EnrichedTextInputView>(),
view?.htmlStyle = HtmlStyle(view, style)
}

@ReactProp(name = ViewProps.COLOR, customType = "Color")
@ReactProp(name = "color", customType = "Color")
override fun setColor(view: EnrichedTextInputView?, color: Int?) {
view?.setColor(color)
}
Expand Down Expand Up @@ -174,6 +173,7 @@ class EnrichedTextInputViewManager : SimpleViewManager<EnrichedTextInputView>(),
view?.setPadding(left, top, right, bottom)
}

@ReactProp(name = "isOnChangeHtmlSet", defaultBoolean = true)
override fun setIsOnChangeHtmlSet(view: EnrichedTextInputView?, value: Boolean) {
// this prop isn't used on Android as of now, but the setter must be present
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace facebook::react {

Size EnrichedTextInputMeasurementManager::measure(
SurfaceId surfaceId,
const EnrichedTextInputViewProps& props,
LayoutConstraints layoutConstraints) const {
const jni::global_ref<jobject>& fabricUIManager =
contextContainer_->at<jni::global_ref<jobject>>("FabricUIManager");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include <react/utils/ContextContainer.h>
#include <react/renderer/core/LayoutConstraints.h>
#include <react/renderer/components/RNEnrichedTextInputViewSpec/Props.h>

namespace facebook::react {

Expand All @@ -16,7 +15,6 @@ namespace facebook::react {

Size measure(
SurfaceId surfaceId,
const EnrichedTextInputViewProps& props,
LayoutConstraints layoutConstraints) const;

private:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include "EnrichedTextInputProps.h"
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/core/propsConversions.h>

namespace facebook::react {

EnrichedTextInputProps::EnrichedTextInputProps(
const PropsParserContext &context,
const EnrichedTextInputProps &sourceProps,
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps) {}

#ifdef RN_SERIALIZABLE_STATE
ComponentName EnrichedTextInputProps::getDiffPropsImplementationTarget() const {
return "EnrichedTextInputView";
}

folly::dynamic EnrichedTextInputProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = EnrichedTextInputProps();
const EnrichedTextInputProps* oldProps = prevProps == nullptr
? &defaultProps
: static_cast<const EnrichedTextInputProps*>(prevProps);
if (this == oldProps) {
return folly::dynamic::object();
}
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
return result;
}
#endif

} // namespace facebook::react
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#include <react/renderer/components/view/ViewProps.h>
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/graphics/Color.h>

namespace facebook::react {

class EnrichedTextInputProps final : public ViewProps {
public:
EnrichedTextInputProps() = default;
EnrichedTextInputProps(const PropsParserContext& context, const EnrichedTextInputProps &sourceProps, const RawProps &rawProps);

#pragma mark - Props

#ifdef RN_SERIALIZABLE_STATE
ComponentName getDiffPropsImplementationTarget() const override;
folly::dynamic getDiffProps(const Props* prevProps) const override;
#endif
};

} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extern const char EnrichedTextInputComponentName[] = "EnrichedTextInputView";
const LayoutContext &layoutContext,
const LayoutConstraints &layoutConstraints) const {

return measurementsManager_->measure(getSurfaceId(), getConcreteProps(), layoutConstraints);
return measurementsManager_->measure(getSurfaceId(), layoutConstraints);
}

} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include "EnrichedTextInputMeasurementManager.h"
#include "EnrichedTextInputState.h"
#include "EnrichedTextInputProps.h"

#include <react/renderer/components/view/ConcreteViewShadowNode.h>
#include <react/renderer/components/RNEnrichedTextInputViewSpec/Props.h>
#include <react/renderer/components/RNEnrichedTextInputViewSpec/EventEmitters.h>

namespace facebook::react {
Expand All @@ -15,7 +15,7 @@ JSI_EXPORT extern const char EnrichedTextInputComponentName[];
*/
class EnrichedTextInputShadowNode final : public ConcreteViewShadowNode<
EnrichedTextInputComponentName,
EnrichedTextInputViewProps,
EnrichedTextInputProps,
EnrichedTextInputViewEventEmitter,
EnrichedTextInputState> {
public:
Expand Down
Loading