Coder Social home page Coder Social logo

Comments (16)

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

I do recall fighting with this when I built it, however I thought I had it licked.
Can you please comment back with your layout for a repro?

Is this it?

<ContentPage>
    <ScrollView>
        <StackLayout>
            <xfx:XfxComboBox />
        </StackLayout>
    <ScrollView>
</ContentPage>

from xfx.controls.

closetoyou293 avatar closetoyou293 commented on July 20, 2024

It happened in 3 case

  1. Place Combobox in second layer
  1. Place combobox in custom control then place that control in scrollview
  1. Combobox is out of view at first time because content of scrollview is too long. => Fixed by forcing re-draw when it focused.

protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
base.OnElementPropertyChanged(sender, e);

        if (e.PropertyName == Entry.IsPasswordProperty.PropertyName)
            KillPassword();
        if (e.PropertyName == XfxComboBox.ItemsSourceProperty.PropertyName)
            SetItemsSource();
        else if (e.PropertyName == XfxComboBox.ThresholdProperty.PropertyName)
            SetThreshold();
        else if (e.PropertyName == "IsFocused")
            SetNeedsDisplay();
    }

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

I've got views with exactly that, and "it works on my machine", however point 3 intrigues me. I'll have to test that one.

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

@closetoyou293 what I really need here is what your markup looks like. Can you just copy/paste the relevant XAML?

from xfx.controls.

closetoyou293 avatar closetoyou293 commented on July 20, 2024
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" 
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:forms="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
             xmlns:xfx="clr-namespace:Xfx;assembly=HomeCreditMock"
             x:Class="Test.Controls.CustomCombobox">
  
        <Grid x:Name="Root" Padding="0" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
        
           <xfx:XfxComboBox x:Name="ComboBox" Grid.Column="0" Grid.ColumnSpan="2" />
        <forms:CachedImage Grid.Column="1" 
                           Source="arrorDropdown" 
                           HorizontalOptions="Center"
                           VerticalOptions="Center"
                           HeightRequest="10"
                           WidthRequest="20">
            <forms:CachedImage.GestureRecognizers>
                <TapGestureRecognizer Tapped="OnTapped"></TapGestureRecognizer>
            </forms:CachedImage.GestureRecognizers>
        </forms:CachedImage>
       </Grid>       
</ContentView>

from xfx.controls.

closetoyou293 avatar closetoyou293 commented on July 20, 2024
<ScrollView>
         <StackLayout HorizontalOptions="FillAndExpand"
                      Padding="10"
                      VerticalOptions="FillAndExpand">
                 <controls:CustomCombobox HorizontalOptions="FillAndExpand"
                                      PlaceHolder="{Binding [RelativeInfo_Relationship]}"
                                      ItemsSource="{Binding RelatedTypes}"
                                      ItemDisplay="Description"
                                      SelectedItem="{Binding FirstRelativeRelationship}"
                                      Margin="20,1,20,1" />
  </StackLayout>
</ScrollView> 

from xfx.controls.

closetoyou293 avatar closetoyou293 commented on July 20, 2024

That scroll view is placed in ContentView. Please put some control so that combobox is only shown when you scroll down, then you will see the bug I mentioned.
Sorry for bad format in my comment :)

from xfx.controls.

e455a81e-d3ba-41a2-bc6d-7aafb1d9a5cd avatar e455a81e-d3ba-41a2-bc6d-7aafb1d9a5cd commented on July 20, 2024

Hi, I was experiencing the same issue and was able to fix it, at least for my specific use-case, by adding the following code to the Draw(...) Method of MbAutoCompleteTextField:

_drawnFrame = Superview.ConvertRectToView(_drawnFrame, UIApplication.SharedApplication.KeyWindow);
view = _parentViewController.View;
frame = new CGRect(_drawnFrame.X, _drawnFrame.Bottom, _drawnFrame.Width, AutocompleteTableViewHeight);

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

@LariscusObscurus are you interested in submitting a PR?

from xfx.controls.

jessejiang0214 avatar jessejiang0214 commented on July 20, 2024

I met the same issue, only on iOS
screen short

Here's code which can reproduce this

<?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:xfx="clr-namespace:Xfx;assembly=Xfx.Controls"
             xmlns:app="clr-namespace:Xfx.Controls.Example.Features.Controls;assembly=Xfx.Controls.Example"
             x:Class="Xfx.Controls.Example.Features.Controls.ControlsPage"
             ControlTemplate="{StaticResource TestTemplate}"
             Title="Custom Controls Example">
    <ContentPage.BindingContext>
        <app:MainPageModel />
    </ContentPage.BindingContext>
    <ContentPage.Resources>
        <ResourceDictionary>
            <Style TargetType="Label">
                <Setter Property="VerticalTextAlignment" Value="Center" />
            </Style>
            <ControlTemplate x:Key="TestTemplate">
                <ScrollView>
                    <Grid Padding="20">   
                         <ContentPresenter Margin="0,10,0,0" />
                    </Grid>
                </ScrollView>
            </ControlTemplate>
        </ResourceDictionary>
    </ContentPage.Resources>
        <Grid RowSpacing="0" ColumnSpacing="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="2*" />
            </Grid.ColumnDefinitions>

            <Label Grid.Row="0" Grid.Column="0" Text="ComboBox" />
            <xfx:XfxComboBox Grid.Row="0"
                             Grid.Column="1"
                             Placeholder="Enter your email address"
                             ActivePlaceholderColor="BlueViolet"
                             ItemSelected="Email_ItemSelected"
                             Focused="Email_OnFocused" 
                             Unfocused="Email_OnUnfocused"
                             SelectedItem="{Binding SelectedItem}"
                             Text="{Binding EmailAddress}"
                             ItemsSource="{Binding EmailSuggestions}"
                             SortingAlgorithm="{Binding SortingAlgorithm}" />

            <Label Grid.Row="1" Grid.Column="0" Text="Material Entry" />
            <xfx:XfxEntry Grid.Row="1"
                          Grid.Column="1"
                          Placeholder="Enter your name"
                          Text="{Binding Name}"
                          ErrorText="{Binding NameErrorText}" />

            <Label Grid.Row="2" Grid.Column="0" Text="No Error Message" />
            <xfx:XfxEntry Grid.Row="2"
                          Grid.Column="1"
                          Placeholder="Enter your name (error message won't show)"
                          ErrorDisplay="None"
                          Text="{Binding Name}"
                          ErrorText="{Binding NameErrorText}" />

            <Label Grid.Row="3" Grid.Column="0" Text="No Floating Label" />
            <xfx:XfxEntry Grid.Row="3"
                          Grid.Column="1"
                          Placeholder="This hint won't float, and it's a password entry"
                          Text="{Binding Foo}"
                          ErrorText="{Binding FooErrorText}"
                          IsPassword="True"
                          FloatingHintEnabled="False" />

            <Label Grid.Row="4" Grid.Column="0" Text="Change Colors" />
            <xfx:XfxEntry Grid.Row="4"
                          Grid.Column="1"
                          Placeholder="Change Colors"
                          PlaceholderColor="DodgerBlue"
                          ActivePlaceholderColor="BlueViolet"
                          TextColor="Crimson"
                          Text="{Binding Foo}" />

            <Label Grid.Row="5" Grid.Column="0" Text="Font Sizes" />
            <xfx:XfxEntry Grid.Row="5"
                          Grid.Column="1"
                          FontSize="10"
                          Placeholder="Enter something "/>
        </Grid>
</ContentPage>

And @LariscusObscurus 's solution cannot work in this case.

from xfx.controls.

SagarPanwala avatar SagarPanwala commented on July 20, 2024

Anyone is working on this ?

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

I haven't fixed this yet, but I do have a question. Are you wrapping your layout in a ScrollView?

from xfx.controls.

SagarPanwala avatar SagarPanwala commented on July 20, 2024

from xfx.controls.

ChaseFlorell avatar ChaseFlorell commented on July 20, 2024

if it's not too much trouble, could you copy/paste your XAML?

from xfx.controls.

SagarPanwala avatar SagarPanwala commented on July 20, 2024

I'm able to reproduce this with your sample as well. Just replace this Control.xaml file will be enough to reproduce the issue and don't forgot to change extension from txt to xaml.

ControlsPage.txt

from xfx.controls.

BeranekCZ avatar BeranekCZ commented on July 20, 2024

I have same problem. When ComboBox is inside ContentPage.Content->ScrollView->StackLayout everything is ok. But when I put ComboBox inside ContentPage.Content->ScrollView->StackLayout->StackLayout or AbsoluteLayout I get same error. List of choices is over entry

from xfx.controls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.