Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] RadioButton and Shapes not re-rendering correctly in Shell and other cases of View Reuse #12245

Closed
davidortinau opened this issue Sep 25, 2020 · 1 comment · Fixed by #13284
Assignees
Labels
a/radiobutton 🔘 a/shell 🐚 blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. e/3 🕒 3 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often t/bug 🐛
Milestone

Comments

@davidortinau
Copy link
Contributor

Description

When initially displayed the radio buttons are fine, but when going back to the same page the UI is not fully rendered.

I tested NavigationPage and TabbedPage containers which worked fine. Shell seems to be the one with issues.

https://github.com/davidortinau/ThemeGallery/tree/bug/fiveoh

Expected Behavior

Screen Shot 2020-09-24 at 8 41 09 PM

Actual Behavior

Screen Shot 2020-09-24 at 8 41 18 PM

Basic Information

  • Version with issue: 5.0-pre1 and nightly
  • Platform Target Frameworks:
    • iOS: iOS14

Reproduction Link

https://github.com/davidortinau/ThemeGallery/tree/bug/fiveoh

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
  xmlns="http://xamarin.com/schemas/2014/forms"
  xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  xmlns:vm="clr-namespace:ThemeGallery.ViewModels"
  xmlns:local="clr-namespace:ThemeGallery"
  x:Class="ThemeGallery.Views.RadioButtonsPage"
  Title="RadioButton">
  <ContentPage.BindingContext>
    <vm:AppViewModel />
  </ContentPage.BindingContext>

  <ContentPage.Resources>
    <ResourceDictionary>
      <ControlTemplate
        x:Key="CalendarRadioTemplate">
        <Frame
          BorderColor="#F3F2F1"
          BackgroundColor="#F3F2F1"
          HasShadow="False"
          HeightRequest="100"
          WidthRequest="100"
          HorizontalOptions="Start"
          VerticalOptions="Start"
          Padding="0">

          <VisualStateManager.VisualStateGroups>
            <VisualStateGroupList>
              <VisualStateGroup
                x:Name="CheckedStates">

                <VisualState
                  x:Name="Checked">
                  <VisualState.Setters>
                    <Setter
                      Property="BorderColor"
                      Value="#FF3300" />
                    <Setter
                      TargetName="Check"
                      Property="Opacity"
                      Value="1" />
                  </VisualState.Setters>
                </VisualState>

                <VisualState
                  x:Name="Unchecked">
                  <VisualState.Setters>
                    <Setter
                      Property="BackgroundColor"
                      Value="#f3f2f1" />
                    <Setter
                      Property="BorderColor"
                      Value="#f3f2f1" />
                    <Setter
                      TargetName="Check"
                      Property="Opacity"
                      Value="0" />
                  </VisualState.Setters>
                </VisualState>

              </VisualStateGroup>
            </VisualStateGroupList>
          </VisualStateManager.VisualStateGroups>

          <Grid
            Margin="4"
            WidthRequest="100">
            <Grid
              WidthRequest="18"
              HeightRequest="18"
              HorizontalOptions="End"
              VerticalOptions="Start">
              <Ellipse
                Stroke="#FF3300"
                WidthRequest="16"
                HeightRequest="16"
                StrokeThickness="0.5"
                VerticalOptions="Center"
                HorizontalOptions="Center"
                Fill="White" />
              <Ellipse
                x:Name="Check"
                WidthRequest="8"
                HeightRequest="8"
                Fill="#FF3300"
                VerticalOptions="Center"
                HorizontalOptions="Center" />
            </Grid>
            <ContentPresenter></ContentPresenter>
          </Grid>
        </Frame>
      </ControlTemplate>
    </ResourceDictionary>
  </ContentPage.Resources>

  <ScrollView>
    <StackLayout
      Margin="24,20"
      Spacing="20">

      <Label
        Text="{Binding SelectedTheme}"
        Margin="0,0,0,20"
        HeightRequest="40"
        VerticalTextAlignment="Center"
        Style="{ DynamicResource TextHeadline }" />

      <Label
        Text="RadioButton"
        Style="{ DynamicResource TextSubHead }" />

      <StackLayout
        RadioButtonGroup.GroupName="SimpleRadios"
        Orientation="Horizontal">

        <RadioButton
          Content="Day" />
        <RadioButton
          Content="Week" />
        <RadioButton
          Content="Month" />
      </StackLayout>

      <StackLayout
        Orientation="Horizontal"
        RadioButtonGroup.GroupName="CalendarMode">
        <RadioButton
          ControlTemplate="{StaticResource 
                        CalendarRadioTemplate}">
          <RadioButton.Content>
            <StackLayout
              HorizontalOptions="Center"
              VerticalOptions="Center">
              <Image
                Source="{FontImage FontFamily=FontAwesome, 
                        Glyph={x:Static local:IconFont.CalendarDay}, 
                        Color=#323130,Size=32}" />
              <Label
                Text="Day"
                TextColor="#323130" />
            </StackLayout>
          </RadioButton.Content>
        </RadioButton>
        <RadioButton
          ControlTemplate="{StaticResource 
                        CalendarRadioTemplate}">
          <RadioButton.Content>
            <StackLayout
              HorizontalOptions="Center"
              VerticalOptions="Center">
              <Image
                Source="{FontImage FontFamily=FontAwesome, 
                        Glyph={x:Static local:IconFont.CalendarWeek}, 
                        Color=#323130,Size=32}" />
              <Label
                Text="Week"
                TextColor="#323130" />
            </StackLayout>
          </RadioButton.Content>
        </RadioButton>
        <RadioButton
          ControlTemplate="{StaticResource 
                        CalendarRadioTemplate}">
          <RadioButton.Content>
            <StackLayout
              HorizontalOptions="Center"
              VerticalOptions="Center">
              <Image
                Source="{FontImage FontFamily=FontAwesome, 
                        Glyph={x:Static local:IconFont.Calendar}, 
                        Color=#323130,Size=32}" />
              <Label
                Text="Month"
                TextColor="#323130" />
            </StackLayout>
          </RadioButton.Content>
        </RadioButton>
      </StackLayout>

      <Button
        Text="Go To Checkboxes"
        Clicked="Button_Clicked" />
    </StackLayout>
  </ScrollView>
</ContentPage>
@davidortinau davidortinau added t/bug 🐛 s/unverified New report that has yet to be verified labels Sep 25, 2020
@samhouts samhouts added this to New in Triage Sep 25, 2020
@rmarinho rmarinho removed the s/unverified New report that has yet to be verified label Sep 25, 2020
@rmarinho rmarinho moved this from New to Ready For Work in Triage Sep 25, 2020
@rmarinho rmarinho added e/3 🕒 3 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often labels Sep 25, 2020
@samhouts samhouts added this to the 5.0.0 milestone Sep 29, 2020
@samhouts samhouts added this to To do in vNext+1 (5.0.0) Oct 1, 2020
@davidortinau davidortinau added the blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. label Oct 6, 2020
@hartez hartez removed this from Ready For Work in Triage Oct 7, 2020
@hartez hartez added this to To do in iOS Ready For Work via automation Oct 7, 2020
@ccsousa01
Copy link

I am experiencing the same thing on iOS 14 device using Xamarin Forms 5 pre-release. I have radio buttons located on a page which I navigate to using Navigation.PopModalAsync(myModalPageInstance). The RadioButtons render fine on the first visit, but if I Pop the modal page and then navigate back to it, the RadioButtons do not render; though the Text does.

@rmarinho rmarinho moved this from To do to Blockers in vNext+1 (5.0.0) Oct 28, 2020
@samhouts samhouts moved this from Blockers to To do 2 in vNext+1 (5.0.0) Nov 3, 2020
@samhouts samhouts moved this from To do 2 to Blockers in vNext+1 (5.0.0) Nov 3, 2020
@PureWeen PureWeen modified the milestones: 5.0.0, 5.0.1 Dec 30, 2020
@PureWeen PureWeen added this to To do in v5.0.1 via automation Dec 30, 2020
@PureWeen PureWeen removed this from Blockers in vNext+1 (5.0.0) Dec 30, 2020
@PureWeen PureWeen assigned PureWeen and unassigned hartez Jan 4, 2021
@PureWeen PureWeen changed the title [Bug] RadioButtons not re-rendering correctly in Shell [Bug] RadioButton/Shapes not re-rendering correctly in Shell and other cases of View Reuse Jan 5, 2021
@PureWeen PureWeen changed the title [Bug] RadioButton/Shapes not re-rendering correctly in Shell and other cases of View Reuse [Bug] RadioButton and Shapes not re-rendering correctly in Shell and other cases of View Reuse Jan 5, 2021
iOS Ready For Work automation moved this from To do to Done Jan 15, 2021
v5.0.1 automation moved this from To do to Done Jan 15, 2021
rmarinho pushed a commit that referenced this issue Jan 15, 2021
…o renderer creation (#13284) fixes #12245 fixes #13225 fixes #12911 fixes #13096 fixes #13164 fixes #11924 fixes #11656 fixes #12844 fixes #12521 fixes #13407

* UI Test

* Render Shape if it has an initial size already set

* - fix ui tests

* Unified issues with the same fix.

Co-authored-by: Javier Suárez Ruiz <javiersuarezruiz@hotmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/radiobutton 🔘 a/shell 🐚 blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. e/3 🕒 3 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often t/bug 🐛
Projects
6 participants