Skip to content

Commit a8b4c19

Browse files
CopilotSaadnajmi
andcommitted
Address code review feedback: reset clipsToBounds when no borders and in prepareForRecycle
Co-authored-by: Saadnajmi <[email protected]>
1 parent 09bb94a commit a8b4c19

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,9 @@ - (void)updateLayoutMetrics:(const LayoutMetrics &)layoutMetrics
432432
// Note: Setting clipsToBounds ensures Core Animation border rendering is used,
433433
// which properly displays with the native text field subview on macOS
434434
self.clipsToBounds = YES;
435+
} else {
436+
// Reset clipsToBounds when no borders are present
437+
self.clipsToBounds = NO;
435438
}
436439
#endif // macOS]
437440

@@ -461,6 +464,10 @@ - (void)prepareForRecycle
461464
_ignoreNextTextInputCall = NO;
462465
_didMoveToWindow = NO;
463466
[_backedTextInputView resignFirstResponder];
467+
#if TARGET_OS_OSX // [macOS
468+
// Reset clipsToBounds to prevent state leakage in recycled components
469+
self.clipsToBounds = NO;
470+
#endif // macOS]
464471
}
465472

466473
#pragma mark - RCTBackedTextInputDelegate

0 commit comments

Comments
 (0)