CosmicMind / Material

A UI/UX framework for creating beautiful applications.
http://cosmicmind.com
MIT License
11.98k stars 1.26k forks source link

tint color for Textfields #1229

Closed mohpor closed 5 years ago

mohpor commented 5 years ago

Hi,

Material 3.x introduces a bug where the tint color of a text field will be ignored completely, because, you are changing it based on placeholder's colors (Active/Normal) in the process. It has consequences for someone who doesn't have a placeholder and want to set the tint color.

I guess the tint color explicitly set by user should override such behavior.

For now, the workaround is to set both placeholderActiveColor and placeholderNormalColor to your desired color to achieve a simple tintColor!

Update: I guess this is not new and has been a case since Material 2 (at least)

OrkhanAlikhanov commented 5 years ago

We forceable update tintColor to a single value placeholderActiveColor.

https://github.com/CosmicMind/Material/blob/3e2637838e446e8a2bfc550129bf5766e7f88af4/Sources/iOS/Text/TextField.swift#L535-L538 I think we can set it once in didSet of placeholderActiveColor.

@danieldahan What do you think worth updating?

daniel-jonathan commented 5 years ago

@OrkhanAlikhanov I think @mohpor's point is a really good one. Maybe we only need to update both values like @mohpor mentioned when a user sets the tintColor. We still do want to use the placeholder(Active/Normal)Color functionality. Thoughts?