File tree Expand file tree Collapse file tree
packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -420,6 +420,21 @@ - (void)updateLayoutMetrics:(const LayoutMetrics &)layoutMetrics
420420{
421421 CGSize previousContentSize = _backedTextInputView.contentSize ;
422422
423+ #if TARGET_OS_OSX // [macOS
424+ // On macOS, ensure proper border rendering by enabling clip to bounds
425+ // when borders are present. This forces Core Animation border rendering
426+ // which displays correctly with the native text field subview.
427+ const auto &props = static_cast <const TextInputProps &>(*_props);
428+ const auto borderMetrics = props.resolveBorderMetrics (layoutMetrics);
429+ BOOL hasBorder = borderMetrics.borderWidths .left > 0 || borderMetrics.borderWidths .right > 0 ||
430+ borderMetrics.borderWidths .top > 0 || borderMetrics.borderWidths .bottom > 0 ;
431+ if (hasBorder) {
432+ // Note: Setting clipsToBounds ensures Core Animation border rendering is used,
433+ // which properly displays with the native text field subview on macOS
434+ self.clipsToBounds = YES ;
435+ }
436+ #endif // macOS]
437+
423438 [super updateLayoutMetrics: layoutMetrics oldLayoutMetrics: oldLayoutMetrics];
424439
425440#if TARGET_OS_OSX // [macOS
You can’t perform that action at this time.
0 commit comments