- Home
- Forum
- Xamarin.Forms
- SfPopupLayout shrinks size when text input into inputLayout/entry
SfPopupLayout shrinks size when text input into inputLayout/entry
Dear Syncfusion-Team,
Attachment: PopupLayout_d76bcb08.zip
I followed your example from Xamarin Essential Studio for PopupLayout. I use the XAML code from 'FullScreenDialog'.
When the user enters text into inputLayout/ entry the whole PopupLayout shrinks to show the button/s from the footer. Thats fine, so the user can exit PopupLayout whenever he wants.
But if the user does not end the input of the entry with the 'done' button of the keyboard, instead the entry loses focus, the whole PopupLayout stays in the shrinked format (as you can see from the attached video).
Is this behavior on purpose, because I would have expected that the PopupLayout gets back to FullScreen?
Regards,
Andreas
Attachment: PopupLayout_d76bcb08.zip
SIGN IN To post a reply.
11 Replies
1 reply marked as answer
CS
Chandrasekar Sampathkumar
Syncfusion Team
April 19, 2021 07:06 AM UTC
Hi Andreas,
Thank you for using Syncfusion products.
We have checked the reported query from our end. We have prepared simple sample based on your requirement and we regret to let you know that we are not able to replicate the reported issue. We have attached the tested sample and output video for your reference and you can download the same using the following link,
Sample Link: Sample
Output Video: Video
If possible could you please replicate the issue for us in the shared sample or could you please share the following details which would be helpful for us to check on it and provide you solution at the earliest,
- Xamarin.Forms version and Syncfusion version used in your application
Regards,
Chandrasekar Sampathkumar
Marked as answer
AN
Andreas
April 19, 2021 07:48 PM UTC
Hi Chandrasekar,
Thank you for your example! It is working as I expected it.
I tried to reproduce the behaviour from my video in your solution but did not manage it yet.
I'm using Android 11 with Xamarin.Forms 5.0.0.2012 and SfPopupLayout 19.1.0.56.
I updated your solution to the same szenario...and it is working fine.
I will get back to you, when I found my bug resp. what is different between our two solutions.
Regards,
Andreas
CS
Chandrasekar Sampathkumar
Syncfusion Team
April 20, 2021 05:30 AM UTC
Hi Andreas,
Thank you for the update. We will wait for your further response.
Regards,
Chandrasekar Sampathkumar
AN
Andreas
April 20, 2021 07:13 PM UTC
Hi Chandrasekar,
Attachment: TestPopupLayout_b6b56e9f.zip
I attached an example (solution and video) that shows the same behavior as in my initial post.
The reason is the way I implemented SfPopupLayout into ContentPage.
Regards,
Andreas
Attachment: TestPopupLayout_b6b56e9f.zip
AN
Andreas
April 21, 2021 05:01 PM UTC
Hello,
So two questions arise from that:
- How can this exception be prevented?
or
- How to implement SfPopupLayout in a correct way, as attached in the solution I sent yesterday?
Regards,
Andreas
Attachment: NullPointerException_97c91b41.zip
CS
Chandrasekar Sampathkumar
Syncfusion Team
April 22, 2021 01:19 PM UTC
Hi Andreas,
Thank you for the update.
We would like to let you know that we are able to replicate PopupLayout not resized issue in Android 11 device/emulator. We are currently working on it and provide further details on April 23, 2021.
Regarding NullException,
We suspect that SfPopupLayout is not being passed as CommandParameter for button. Please refer the following code snippets for more reference,
|
<popuplayout:SfPopupLayout x:Name="popup"
IsOpen="{Binding DisplayPopup}">
<!--PopupLayout: Layout of Popup-->
<popuplayout:SfPopupLayout.PopupView>
<popuplayout:PopupView …>
<!--Header-->
<popuplayout:PopupView.HeaderTemplate>
…
</popuplayout:PopupView.HeaderTemplate>
<!--Content-->
<popuplayout:PopupView.ContentTemplate>
…
</popuplayout:PopupView.ContentTemplate>
</popuplayout:PopupView>
</popuplayout:SfPopupLayout.PopupView>
<popuplayout:SfPopupLayout.Content>
<StackLayout>
<Button Text="Click to open popup" VerticalOptions="Center" HorizontalOptions="Center" Command="{Binding ShowPopupCommand}" CommandParameter="{x:Reference popup}"/>
</StackLayout>
</popuplayout:SfPopupLayout.Content>
</popuplayout:SfPopupLayout> |
Regards,
Chandrasekar Sampathkumar
AN
Andreas
April 22, 2021 06:25 PM UTC
Hi Chandrasekar,
Attachment: TestPopupLayout_NullException_527b9ffd.zip
thank your for your update!
Regarding NullException
Sorry for mixing two issues in one thread. The attached solution is my attempt to emulate your sample from April 19th to my example from April 20th, which gives the NullReferenceExecption instead. Even though I integrated the reference you mentioned today.
Regards,
Andreas
Attachment: TestPopupLayout_NullException_527b9ffd.zip
CS
Chandrasekar Sampathkumar
Syncfusion Team
April 25, 2021 06:22 PM UTC
Hi Andreas,
Sorry for the inconvenience caused.
We need some more time to validate this issue. We will update you further details in two business days (April 27th, 2021). We appreciate your patience until then.
Regards,
Chandrasekar Sampathkumar
KK
Karthikraja Kalaimani
Syncfusion Team
April 27, 2021 06:10 PM UTC
Hi Andreas,
Thanks for your patience.
We have checked the reported issue “Popup height didn’t change when keyboard close in Android 11 devices” in our source. We actually calculate popup height when keyboard appear and disappear in LayoutChange event of the DecorView which is RootView of the application. In android 11 devices sometimes the LayoutChange event is not triggered. So only the popup height is not changed. However, we found a workaround to overcome the issue. Please refer to the below code snippet.
Code snippet :
Thanks for your patience.
We have checked the reported issue “Popup height didn’t change when keyboard close in Android 11 devices” in our source. We actually calculate popup height when keyboard appear and disappear in LayoutChange event of the DecorView which is RootView of the application. In android 11 devices sometimes the LayoutChange event is not triggered. So only the popup height is not changed. However, we found a workaround to overcome the issue. Please refer to the below code snippet.
Code snippet :
|
<popuplayout:SfPopupLayout x:Name="popup"
IsOpen="{Binding DisplayPopup}"> <!--PopupLayout: Layout of Popup-->
<popuplayout:SfPopupLayout.PopupView> <popuplayout:PopupView AcceptButtonText="Save" AcceptCommand="{Binding PopupAcceptCommand}" AnimationMode="SlideOnBottom" IsFullScreen="True"> <!--Header--> <popuplayout:PopupView.HeaderTemplate> <DataTemplate> <StackLayout Padding="5"> <Label FontSize="Medium" Text="TestPopup"/> </StackLayout> </DataTemplate> </popuplayout:PopupView.HeaderTemplate> <!--Content-->
<popuplayout:PopupView.ContentTemplate> <DataTemplate > <StackLayout CompressedLayout.IsHeadless="True" Padding="5"> <Label Text="Here stands some describing text"/> <Entry Margin="0,5,0,5" Unfocused="Entry_Unfocused" Placeholder="enter some text" Text="{Binding PopupEntryPurpose, Mode=OneWayToSource}"/> <Grid ColumnDefinitions="*,*"> <Label Text="Picker" VerticalTextAlignment="Center"/> <Picker Grid.Column="1" FontSize="Small" ItemsSource="{Binding StrategyPicker}" SelectedIndex="{Binding StrategyPickerSelectedIndex}"/> </Grid> <Grid ColumnDefinitions="*,50"> <Label Text="Switch Something"/> <Switch Grid.Column="1" IsToggled="{Binding SampleAccounts}"/> </Grid> </StackLayout> </DataTemplate> </popuplayout:PopupView.ContentTemplate> </popuplayout:PopupView>
</popuplayout:SfPopupLayout.PopupView> <popuplayout:SfPopupLayout.Content>
<StackLayout> <Button Text="Click to open popup" VerticalOptions="Center" HorizontalOptions="Center" Command="{Binding ShowPopupCommand}" CommandParameter="{x:Reference popup}"/> </StackLayout> </popuplayout:SfPopupLayout.Content> </popuplayout:SfPopupLayout> …
public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); } void Entry_Unfocused(System.Object sender, Xamarin.Forms.FocusEventArgs e)
{ popup.PopupView.Refresh(); } } |
Regarding the “Null Reference exception”, we suspect that you have displayed the popup on the go (Type B), so you need to call SfPopupLayoutRenderer.Init() on MainAcitivity.cs in Android project. Please refer to the below UG document to know the Renderer Initialization for SfPopupLayout.
https://help.syncfusion.com/xamarin/popup/getting-started#android
Regards,
Karthik Raja
AN
Andreas
April 28, 2021 05:28 PM UTC
Hello Karthick,
Thank you for your feedback on both issues!
Both work as you suggested, which is awesome!
Regards,
Andreas
KK
Karthikraja Kalaimani
Syncfusion Team
April 29, 2021 05:00 AM UTC
Hi Andreas,
Thanks for the update. We glad to know that the provided solution is fixed your problems. Please let us know if you need further assistance from us.
Regards,
Karthik Raja
Thanks for the update. We glad to know that the provided solution is fixed your problems. Please let us know if you need further assistance from us.
Regards,
Karthik Raja
SIGN IN To post a reply.
- 11 Replies
- 3 Participants
- Marked answer
-
AN Andreas
- Apr 18, 2021 07:46 PM UTC
- Apr 29, 2021 05:00 AM UTC