@@ -560,10 +560,7 @@ private void DrawUnderlay(IUnderlayDrawable underlayDrawable, View element, Rect
560560 var internalMargin = underlayDrawable . InternalMargin ;
561561
562562 float placeholderFontSize = underlayDrawable . ActivePlaceholderFontSize * scale ;
563- var placeholderColor =
564- underlayDrawable . PlaceholderColor != default ( Color )
565- ? underlayDrawable . PlaceholderColor
566- : HavePlaceholderElement . DefaultPlaceholderColor ;
563+ var placeholderColor = underlayDrawable . PlaceholderColor ;
567564
568565 float fontSize = ( float ) underlayDrawable . FontSize * scale ;
569566
@@ -722,26 +719,31 @@ private void DrawUnderlay(IUnderlayDrawable underlayDrawable, View element, Rect
722719 }
723720 else if ( ! string . IsNullOrEmpty ( placeholder ) )
724721 {
725- _placeholderPaint . Color =
726- placeholderColor
727- . Lerp (
728- underlayDrawable . ActiveColor ,
729- focusAnimationPercentage > 0d ? focusAnimationPercentage : hasValueAnimationPercentage )
730- . ToSKColor ( ) ;
731-
732722 if ( placeholderFontSize > 0d )
733723 {
734- double placeholderY = controlYCenter . Lerp ( focusedPlaceholderCenterY , hasValueAnimationPercentage ) ;
724+ var currentColor = isFocused ? underlayDrawable . ActiveColor : underlayDrawable . InactiveColor ;
725+
726+ if ( currentColor . Alpha > 0.0f )
727+ {
728+ _placeholderPaint . Color =
729+ placeholderColor
730+ . Lerp (
731+ currentColor ,
732+ focusAnimationPercentage > 0d ? focusAnimationPercentage : hasValueAnimationPercentage )
733+ . ToSKColor ( ) ;
735734
736- _placeholderPaint . TextSize = fontSize . Lerp ( placeholderFontSize , ( float ) hasValueAnimationPercentage ) ;
737- _placeholderPaint . Color = _placeholderPaint . Color . WithAlpha ( ( float ) hasValueAnimationPercentage ) ;
735+ double placeholderY = controlYCenter . Lerp ( focusedPlaceholderCenterY , hasValueAnimationPercentage ) ;
738736
739- _placeholderPaint . EnsureHasValidFont ( placeholder ) ;
737+ _placeholderPaint . TextSize = fontSize . Lerp ( placeholderFontSize , ( float ) hasValueAnimationPercentage ) ;
738+ _placeholderPaint . Color = _placeholderPaint . Color . WithAlpha ( ( float ) hasValueAnimationPercentage ) ;
740739
741- canvas . DrawTextCenteredVertically ( placeholder , new SKPoint ( ( float ) controlXLeft , ( float ) placeholderY ) , _placeholderPaint ) ;
740+ _placeholderPaint . EnsureHasValidFont ( placeholder ) ;
741+
742+ canvas . DrawTextCenteredVertically ( placeholder , new SKPoint ( ( float ) controlXLeft , ( float ) placeholderY ) , _placeholderPaint ) ;
743+ }
742744 }
743745
744- _placeholderPaint . Color = placeholderColor . ToSKColor ( ) . WithAlpha ( 1f - ( float ) hasValueAnimationPercentage ) ;
746+ _placeholderPaint . Color = ( placeholderColor ? . ToSKColor ( ) ?? SKColors . Transparent ) . WithAlpha ( 1f - ( float ) hasValueAnimationPercentage ) ;
745747 _placeholderPaint . TextSize = fontSize ;
746748
747749 canvas . DrawTextCenteredVertically ( placeholder , new SKPoint ( ( float ) controlXLeft , ( float ) controlYCenter ) , _placeholderPaint ) ;
0 commit comments