Skip to content
Merged
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
5 changes: 1 addition & 4 deletions packages/react-native/Libraries/Text/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import type {
import type {NativeTextProps} from './TextNativeComponent';
import type {PressRetentionOffset, TextProps} from './TextProps';

import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
import {getNativeElementReference} from '../../src/private/webapis/dom/nodes/internals/NodeInternals';
import NativeDOM from '../../src/private/webapis/dom/nodes/specs/NativeDOM';
import * as PressabilityDebug from '../Pressability/PressabilityDebug';
Expand Down Expand Up @@ -241,9 +240,7 @@ const TextImpl: component(
}
}

if (ReactNativeFeatureFlags.defaultTextToOverflowHidden()) {
_style = [styles.default, _style];
}
_style = [styles.default, _style];

const _nativeID = id ?? nativeID;

Expand Down
14 changes: 14 additions & 0 deletions packages/react-native/Libraries/Text/__tests__/Text-itest.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ describe('<Text>', () => {
});
});

describe('overflow', () => {
it('preserves an explicit visible overflow style', () => {
const root = Fantom.createRoot();

Fantom.runTask(() => {
root.render(<Text style={{overflow: 'visible'}}>{TEST_TEXT}</Text>);
});

expect(root.getRenderedOutput({props: ['overflow']}).toJSX()).toEqual(
<rn-paragraph>{TEST_TEXT}</rn-paragraph>,
);
});
});

describe('fontVariationSettings', () => {
it('serializes object settings', () => {
const root = Fantom.createRoot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<3a6a61e2cc2bf01a35ab5c3919462ad5>>
* @generated SignedSource<<76de3194871662436634e25b8485341e>>
*/

/**
Expand Down Expand Up @@ -48,12 +48,6 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun cxxNativeAnimatedEnabled(): Boolean = accessor.cxxNativeAnimatedEnabled()

/**
* When enabled, sets the default overflow style for Text components to hidden instead of visible.
*/
@JvmStatic
public fun defaultTextToOverflowHidden(): Boolean = accessor.defaultTextToOverflowHidden()

/**
* When enabled, iOS TextInput applies edits that JS transforms (e.g. maxLength truncation) incrementally after the UIKit text change delegate call returns, avoiding synchronous text and selection rewrites that can deadlock UIKeyboardTaskQueue.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<fe927f4acf804e05b74dbe606e39746f>>
* @generated SignedSource<<9b5e3dd88d7b506366fe255d80b17d3c>>
*/

/**
Expand All @@ -23,7 +23,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var commonTestFlagCache: Boolean? = null
private var cdpInteractionMetricsEnabledCache: Boolean? = null
private var cxxNativeAnimatedEnabledCache: Boolean? = null
private var defaultTextToOverflowHiddenCache: Boolean? = null
private var deferTextInputTruncationIOSCache: Boolean? = null
private var disableEarlyViewCommandExecutionCache: Boolean? = null
private var disableIdleEventDispatchFrameCallbackRearmAndroidCache: Boolean? = null
Expand Down Expand Up @@ -152,15 +151,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

override fun defaultTextToOverflowHidden(): Boolean {
var cached = defaultTextToOverflowHiddenCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.defaultTextToOverflowHidden()
defaultTextToOverflowHiddenCache = cached
}
return cached
}

override fun deferTextInputTruncationIOS(): Boolean {
var cached = deferTextInputTruncationIOSCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<b58702a0f594f409c0d20fd497395fde>>
* @generated SignedSource<<d61dce9d52b51e0a00144d0f9f6b330e>>
*/

/**
Expand Down Expand Up @@ -34,8 +34,6 @@ public object ReactNativeFeatureFlagsCxxInterop {

@DoNotStrip @JvmStatic public external fun cxxNativeAnimatedEnabled(): Boolean

@DoNotStrip @JvmStatic public external fun defaultTextToOverflowHidden(): Boolean

@DoNotStrip @JvmStatic public external fun deferTextInputTruncationIOS(): Boolean

@DoNotStrip @JvmStatic public external fun disableEarlyViewCommandExecution(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<834b0e9533cbc775a1c12b86140d718d>>
* @generated SignedSource<<b7d74a3f02bd03cdb690692033bfa634>>
*/

/**
Expand All @@ -29,8 +29,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun cxxNativeAnimatedEnabled(): Boolean = true

override fun defaultTextToOverflowHidden(): Boolean = true

override fun deferTextInputTruncationIOS(): Boolean = false

override fun disableEarlyViewCommandExecution(): Boolean = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<15c65d4497fd9f36f8902efb2812b3b2>>
* @generated SignedSource<<fc376313e5c15a111d04d1a680fe23f5>>
*/

/**
Expand All @@ -27,7 +27,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var commonTestFlagCache: Boolean? = null
private var cdpInteractionMetricsEnabledCache: Boolean? = null
private var cxxNativeAnimatedEnabledCache: Boolean? = null
private var defaultTextToOverflowHiddenCache: Boolean? = null
private var deferTextInputTruncationIOSCache: Boolean? = null
private var disableEarlyViewCommandExecutionCache: Boolean? = null
private var disableIdleEventDispatchFrameCallbackRearmAndroidCache: Boolean? = null
Expand Down Expand Up @@ -159,16 +158,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

override fun defaultTextToOverflowHidden(): Boolean {
var cached = defaultTextToOverflowHiddenCache
if (cached == null) {
cached = currentProvider.defaultTextToOverflowHidden()
accessedFeatureFlags.add("defaultTextToOverflowHidden")
defaultTextToOverflowHiddenCache = cached
}
return cached
}

override fun deferTextInputTruncationIOS(): Boolean {
var cached = deferTextInputTruncationIOSCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<89f683cb28a7d1ef52c86faa96f1107c>>
* @generated SignedSource<<3bbe32435500fc5b114f4c2781d62335>>
*/

/**
Expand All @@ -29,8 +29,6 @@ public interface ReactNativeFeatureFlagsProvider {

@DoNotStrip public fun cxxNativeAnimatedEnabled(): Boolean

@DoNotStrip public fun defaultTextToOverflowHidden(): Boolean

@DoNotStrip public fun deferTextInputTruncationIOS(): Boolean

@DoNotStrip public fun disableEarlyViewCommandExecution(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<407c8e5915db07bb6cc2b9ba4449750a>>
* @generated SignedSource<<c3a2dca0c66d20793b969aba3a95c95c>>
*/

/**
Expand Down Expand Up @@ -57,12 +57,6 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}

bool defaultTextToOverflowHidden() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("defaultTextToOverflowHidden");
return method(javaProvider_);
}

bool deferTextInputTruncationIOS() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("deferTextInputTruncationIOS");
Expand Down Expand Up @@ -682,11 +676,6 @@ bool JReactNativeFeatureFlagsCxxInterop::cxxNativeAnimatedEnabled(
return ReactNativeFeatureFlags::cxxNativeAnimatedEnabled();
}

bool JReactNativeFeatureFlagsCxxInterop::defaultTextToOverflowHidden(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::defaultTextToOverflowHidden();
}

bool JReactNativeFeatureFlagsCxxInterop::deferTextInputTruncationIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::deferTextInputTruncationIOS();
Expand Down Expand Up @@ -1227,9 +1216,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"cxxNativeAnimatedEnabled",
JReactNativeFeatureFlagsCxxInterop::cxxNativeAnimatedEnabled),
makeNativeMethod(
"defaultTextToOverflowHidden",
JReactNativeFeatureFlagsCxxInterop::defaultTextToOverflowHidden),
makeNativeMethod(
"deferTextInputTruncationIOS",
JReactNativeFeatureFlagsCxxInterop::deferTextInputTruncationIOS),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<7cb5d49e9124d56b3e242e2023db8649>>
* @generated SignedSource<<0af9522f02a71959936872cbcceb4416>>
*/

/**
Expand Down Expand Up @@ -39,9 +39,6 @@ class JReactNativeFeatureFlagsCxxInterop
static bool cxxNativeAnimatedEnabled(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool defaultTextToOverflowHidden(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool deferTextInputTruncationIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<cdff9d8521366a5ab71b9cacd2415c83>>
* @generated SignedSource<<da249cc6a0786db45dfe78ea379608a2>>
*/

/**
Expand Down Expand Up @@ -38,10 +38,6 @@ bool ReactNativeFeatureFlags::cxxNativeAnimatedEnabled() {
return getAccessor().cxxNativeAnimatedEnabled();
}

bool ReactNativeFeatureFlags::defaultTextToOverflowHidden() {
return getAccessor().defaultTextToOverflowHidden();
}

bool ReactNativeFeatureFlags::deferTextInputTruncationIOS() {
return getAccessor().deferTextInputTruncationIOS();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<2ddd9296377ea4c1fd9c84883fbde049>>
* @generated SignedSource<<426c3b0a032da06ae64790ad3a2eaacc>>
*/

/**
Expand Down Expand Up @@ -56,11 +56,6 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool cxxNativeAnimatedEnabled();

/**
* When enabled, sets the default overflow style for Text components to hidden instead of visible.
*/
RN_EXPORT static bool defaultTextToOverflowHidden();

/**
* When enabled, iOS TextInput applies edits that JS transforms (e.g. maxLength truncation) incrementally after the UIKit text change delegate call returns, avoiding synchronous text and selection rewrites that can deadlock UIKeyboardTaskQueue.
*/
Expand Down
Loading
Loading