Skip to content

Commit 056b859

Browse files
committed
fix: color press text color
1 parent e8d59ec commit 056b859

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/InputSpinner.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -903,10 +903,9 @@ class InputSpinner extends Component {
903903
* @private
904904
*/
905905
_getColorPress() {
906-
let color = this.props.color;
907-
if (this.props.colorAsBackground) {
908-
color = defaultTransparent;
909-
}
906+
const color = this.props.colorAsBackground
907+
? defaultTransparent
908+
: this.props.color;
910909
return this.props.colorPress !== defaultColor
911910
? this.props.colorPress
912911
: color;
@@ -918,12 +917,15 @@ class InputSpinner extends Component {
918917
* @private
919918
*/
920919
_getColorPressText() {
920+
const color = this.props.colorAsBackground
921+
? this._getColorBackground()
922+
: this._getColorPress();
921923
const pressColor = this.props.buttonPressTextColor
922924
? this.props.buttonPressTextColor
923-
: getColorContrast(this._getColorPress());
925+
: this._getColorText();
924926
return this.props.buttonPressTextColor !== this.props.buttonTextColor
925927
? pressColor
926-
: this._getColorText();
928+
: getColorContrast(color);
927929
}
928930

929931
/**

0 commit comments

Comments
 (0)