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 @@ -105,8 +105,8 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
_paragraphAttributes = newParagraphProps.paragraphAttributes;
_textView.paragraphAttributes = _paragraphAttributes;

if (newParagraphProps.isSelectable != oldParagraphProps.isSelectable) {
if (newParagraphProps.isSelectable) {
if (newParagraphProps.selectable != oldParagraphProps.selectable) {
if (newParagraphProps.selectable) {
[self enableContextMenu];
} else {
[self disableContextMenu];
Expand Down Expand Up @@ -329,14 +329,14 @@ - (void)handleLongPress:(UILongPressGestureRecognizer *)gesture
- (BOOL)canBecomeFirstResponder
{
const auto &paragraphProps = static_cast<const ParagraphProps &>(*_props);
return paragraphProps.isSelectable;
return paragraphProps.selectable;
}

- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
const auto &paragraphProps = static_cast<const ParagraphProps &>(*_props);

if (paragraphProps.isSelectable && action == @selector(copy:)) {
if (paragraphProps.selectable && action == @selector(copy:)) {
return YES;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ ParagraphProps::ParagraphProps(
rawProps,
sourceProps.paragraphAttributes,
{})),
isSelectable(
selectable(
ReactNativeFeatureFlags::enableCppPropsIteratorSetter()
? sourceProps.isSelectable
? sourceProps.selectable
: convertRawProp(
context,
rawProps,
"selectable",
sourceProps.isSelectable,
sourceProps.selectable,
false)),
onTextLayout(
ReactNativeFeatureFlags::enableCppPropsIteratorSetter()
Expand Down Expand Up @@ -129,7 +129,7 @@ void ParagraphProps::setProp(
}

switch (hash) {
RAW_SET_PROP_SWITCH_CASE_BASIC(isSelectable);
RAW_SET_PROP_SWITCH_CASE_BASIC(selectable);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we instead use: RAW_SET_PROP_SWITCH_CASE(isSelectable, selectable) and not change anything alse?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we can do that , makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cipolleschi closing this pr as this is to old , created a new one for the same .
#52599

RAW_SET_PROP_SWITCH_CASE_BASIC(onTextLayout);
}

Expand All @@ -148,7 +148,7 @@ SharedDebugStringConvertibleList ParagraphProps::getDebugProps() const {
return ViewProps::getDebugProps() + BaseTextProps::getDebugProps() +
paragraphAttributes.getDebugProps() +
SharedDebugStringConvertibleList{
debugStringConvertibleItem("isSelectable", isSelectable)};
debugStringConvertibleItem("selectable", selectable)};
}
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ParagraphProps : public ViewProps, public BaseTextProps {
/*
* Defines can the text be selected (and copied) or not.
*/
bool isSelectable{};
bool selectable{};

bool onTextLayout{};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const char ParagraphComponentName[] = "Paragraph";

void ParagraphShadowNode::initialize() noexcept {
#ifdef ANDROID
if (getConcreteProps().isSelectable) {
if (getConcreteProps().selectable) {
traits_.set(ShadowNodeTraits::Trait::KeyboardFocusable);
}
#endif
Expand Down
Loading