Skip to content

Fix backgroundColor not being applied correctly to TextInput#443

Merged
tom-un merged 2 commits intomicrosoft:masterfrom
tido64:tido/fix-textinput-backgroundcolor
Jun 17, 2020
Merged

Fix backgroundColor not being applied correctly to TextInput#443
tom-un merged 2 commits intomicrosoft:masterfrom
tido64:tido/fix-textinput-backgroundcolor

Conversation

@tido64
Copy link
Copy Markdown
Member

@tido64 tido64 commented Jun 10, 2020

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

Fixes backgroundColor not being applied correctly to TextInput (single-line).

Resolves #415

Changelog

[macOS] [Fixed] - Fix backgroundColor not being applied correctly to TextInput

Test Plan

Before After
image image
Microsoft Reviewers: Open in CodeFlow

@tido64 tido64 requested a review from tom-un as a code owner June 10, 2020 13:58
#if TARGET_OS_OSX // [TODO(macOS ISS#2323203)
self.bordered = NO;
self.accessibilityRole = NSAccessibilityTextFieldRole;
self.backgroundColor = [NSColor clearColor];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does RCTUITextView.m for multi-line TextInputs just work when backgroundColor is set?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think so?
image

diff --git a/RNTester/js/examples/TextInput/TextInputExample.ios.js b/RNTester/js/examples/TextInput/TextInputExample.ios.js
index f21ca72d3..c8bb90377 100644
--- a/RNTester/js/examples/TextInput/TextInputExample.ios.js
+++ b/RNTester/js/examples/TextInput/TextInputExample.ios.js
@@ -530,6 +530,7 @@ const styles = StyleSheet.create({
     padding: 4,
   },
   multiline: {
+    backgroundColor: '#ff00ff',
     borderWidth: StyleSheet.hairlineWidth,
     borderColor: '#0f0f0f',
     flex: 1,

@tido64 tido64 changed the title Fix backgroundColor not being applied to correctly to TextInput Fix backgroundColor not being applied correctly to TextInput Jun 12, 2020
@tom-un tom-un merged commit 2897f37 into microsoft:master Jun 17, 2020
@tido64 tido64 deleted the tido/fix-textinput-backgroundcolor branch June 17, 2020 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot apply background color to TextInput

2 participants