When an entry is enclosed by a SfTextInputLayout, the ClearButtonVisibility option does not work

Hi
I'm having an issue with an maui application i set an entry as inputview in sfTextInputLayout control, the ClearButton does show up but does not work This behaviour can be reproduced by using the following code:

public class Entry : SfTextInputLayout
{

public new Entry InputView
{
get => Content as Entry ??
set => base.Content = value;
}

1 Reply

HC Hariharan Chokkalingam Syncfusion Team December 2, 2024 02:29 PM UTC

Hi,


Thank you for reaching out to us. We have reviewed your query based on the details you provided. From the snippet you shared, we understand that you are trying to create a custom TextInputLayout control with InputView support as an Entry. To address this, we have created a sample with a CustomTextInputLayout control that uses an Entry as its Content. Additionally, we have set the ClearButtonVisibility to WhileEditing for the Entry to ensure the clear button is displayed and works as expected.


Here is the snippet:

 public class CustomTextInputLayout : SfTextInputLayout

 {

     private Entry _inputView;

 

     public Entry InputView

     {

         get => _inputView;

         set

         {

             _inputView = value;

             base.Content = _inputView;

         }

     }

 

     public CustomTextInputLayout()

     {

         // Initialize the InputView in the constructor

         InputView = new Entry

         {

             Placeholder = "Enter text",

         };

 

     }

 }


We have attached the sample for your reference. Kindly review the sample and share your observations. If the issue persists, please provide additional details or modifications to the shared sample, which will help us investigate further and provide a precise solution.


Don’t hesitate to contact us if you have any concerns or further queries.


Regards,

Hariharan


Attachment: TextInputLayoutMaui_b84597fc.zip

Loader.
Up arrow icon