Facing issue when use Editor control in SfTextInputLayout

Hi,

We have used SfTextInputLayout control it's working fine, but when we used Editor control in SfTextInputLayout then Editor placeholder text in center. please check attached screen shot. Need Editor placeholder text as Entry placeholder 

Attachment: editor_9ebf217e.zip

5 Replies 1 reply marked as answer

RS Ramya Soundar Rajan Syncfusion Team August 13, 2020 12:23 PM UTC

 
Greetings from Syncfusion. 
 
We have analyzed your reported query and we would like to inform you that by default the editor text will be placed at the top position even not added inside the SfTextInputLayout. So, it’s a framework level behavior. Please find the screenshot below. 
 
Screenshot1: {Editor control not added inside the SfTextInputLayout } 
 
 
 
Screenshot2: {Editor control added inside the SfTextInputLayout } 
 
 
 
Regards, 
Ramya S 



GS Gursewak Singh August 13, 2020 12:35 PM UTC

Thanks for reply,

But by-default Editor placeholder text at the top, check my code like :-
<Frame
Grid.Row="0"
BorderColor="{StaticResource FrameBorderColor}"
CornerRadius="4">
<control:CustomEditor
MaxLength="500"
Placeholder="{Binding Description}"
PlaceholderColor="#5C5C5C"
TextColor="Black" />
</Frame>

need same in SfTextInputLayout 


RS Ramya Soundar Rajan Syncfusion Team August 14, 2020 07:03 AM UTC

 
We would like to inform you that the reported query that “Placeholder is placed at the center of SfTextInputLayout” is not Editor’s placeholder. That is the Hint text of SfTextInputLayout. The default behaviour of SfTextInputLayout, while applying the Hint text that will be placed at center while focusing that, it will be floated and placed at the top of the control.   
  
SfTextInputLayout value of Hint property is placed at the center, not the Editor placeholder text. You can achieve this requirement by enabling IsHintAlwaysFloated property as per in below snippet.  
 
[XAML] 
        <inputLayout:SfTextInputLayout IsHintAlwaysFloated="True" Hint="Description" 
            ContainerBackgroundColor="White"  ContainerType="Outlined"  
            FocusedColor="Red" OutlineCornerRadius="4" WidthRequest="366" > 
 
             
 
        </inputLayout:SfTextInputLayout> 
 
You can also customize the hint label settings by using HintLabelStyle as per in below code snippet.  
 
            <inputLayout:SfTextInputLayout.HintLabelStyle> 
                <inputLayout:LabelStyle FontSize="16"  
                    
                 /> 
            </inputLayout:SfTextInputLayout.HintLabelStyle> 
 
Regards, 
Ramya S 



GS Gursewak Singh August 14, 2020 07:09 AM UTC

Ramya,

I have found the solution for this, we have fixed this issue using below code.

<textinputlayout:SfTextInputLayout x:Name="sftext" Grid.Row="0"
                                    ContainerType="Outlined"
                                     Hint="Description"
                                    ShowHint="False">
                            <Editor Unfocused="Editor_Unfocused" Focused="Editor_Focused" Placeholder="Description" HeightRequest="100" />
                        </textinputlayout:SfTextInputLayout>

void Editor_Focused(System.Object sender, Xamarin.Forms.FocusEventArgs e)
        {
            sftext.ShowHint = true;
        }
 
        void Editor_Unfocused(System.Object sender, Xamarin.Forms.FocusEventArgs e)
        {
            sftext.ShowHint = false;
        }

this code working fine as per my requirement.

Thank You!!!


Marked as answer

RS Ramya Soundar Rajan Syncfusion Team August 17, 2020 05:13 AM UTC

Hi Gursewak Singh, 
 
We are glad to hear that you have resolved the reported problem.  
  
Please get in touch with us if you would require any further assistance 
 
Regards, 
Ramya S 


Loader.
Up arrow icon