a TabControl bug

Please report bugs here. If you are unsure whether something is a bug or an expected behavior, please post it on the "Technical Support" forum instead, and wait for a moderator to handle/move the post.
holyping
Posts: 1
Joined: Sun Aug 21, 2016 11:38 pm

a TabControl bug

Postby holyping » Sun Aug 21, 2016 11:47 pm

I tested the version downloaded on 22 Oct.
the XAML as below:

Code: Select all

<Page
    x:Class="ht5test.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:ht5test"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <TabControl>
        <TabItem Header="aaa">
            <ScrollViewer VerticalScrollBarVisibility="Auto">
                <StackPanel>
                    <DataGrid x:Name="_grid" Grid.Row="0" AutoGenerateColumns="False">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding f1}" Header="f1"/>
                            <DataGridTextColumn Binding="{Binding f2}" Header="f2"/>
                            <DataGridTextColumn Binding="{Binding f3}" Header="f3"/>
                        </DataGrid.Columns>
                    </DataGrid>
                    <Grid Height="67" Grid.Row="1">
                        <Button x:Name="_bt" Content="Button" HorizontalAlignment="Left" Margin="9,14,0,0" VerticalAlignment="Top" Width="75" Click="button_Click"/>
                        <TextBlock x:Name="_txt" Text="Button"  HorizontalAlignment="Left" Margin="9,50,0,0" VerticalAlignment="Top"  />
                    </Grid>
                </StackPanel>
            </ScrollViewer>
        </TabItem>
        <TabItem Header="bb">
            <TextBlock>aabbbss</TextBlock>
        </TabItem>
    </TabControl>
</Page>


and the code is below

Code: Select all

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace ht5test
{
    public partial class MainPage : Page
    {
        ObservableCollection<DItem> _data = new ObservableCollection<DItem>();
        public MainPage()
        {
            this.InitializeComponent();

            for (int i = 0; i < 3; i++)
            {
                _data.Add(new DItem() { f1 = "aa" + i, f2 = "bb", f3 = "cc" });
            }
            _grid.ItemsSource = _data;
        }

        private void button_Click(object sender, RoutedEventArgs e)
        {
            _data.Add(new DItem() { f1 = "aa", f2 = "bb", f3 = "cc" });
            _txt.Text = string.Join(", ", _data.Select(x => x.f1).ToArray());
        }
    }
    class DItem
    {
        public string f1 { get; set; }
        public string f2 { get; set; }
        public string f3 { get; set; }
    }
}



it reports error when I switched the two tabs in 2 times.
and another bug is when the program starts, the initial view does not show the first tab

JS-Support
Site Admin
Posts: 684
Joined: Tue Apr 08, 2014 3:42 pm

Re: a TabControl bug

Postby JS-Support » Mon Aug 22, 2016 3:54 am

Hi and welcome to the forums.

Thanks for reporting this issue. We are going to fix it in the coming weeks (Beta 9.2 or 9.3).

Regards,
JS-Support

JS-Support
Site Admin
Posts: 684
Joined: Tue Apr 08, 2014 3:42 pm

Re: a TabControl bug

Postby JS-Support » Mon Oct 10, 2016 3:15 am

Hi,

The issue has been fixed in Beta 10.1, available from:
http://forums.cshtml5.com/viewforum.php?f=6

Thanks.
Regards,
JS-Support

Sesztak
Posts: 172
Joined: Fri Jun 24, 2016 2:19 am

Re: [SOLVED] a TabControl bug

Postby Sesztak » Tue Oct 11, 2016 5:57 am

Dear JS-Support,

for your kind information the TabControl is better, but some other bug still exist:

Symptoms:
-Two TabItem get stucked: "two blue line" / like two tabitems selected at the same time:

CSHTML5_10.1TabsStucked.JPG
CSHTML5_10.1TabsStucked.JPG (10.46 KiB) Viewed 783 times


-Unhandled exception:
"Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node."

function INTERNAL_HtmlDomManager_RemoveOptionFromNativeComboBox (optionToRemove, nativeComboBoxDomElement) {
nativeComboBoxDomElement.removeChild(optionToRemove);
};

Please, double check it ! -can you reproduce the bug ?
Really waiting for your solution as actually the only workaround with multiple tabitem to reload the whole page :(((

Thanks in advance,
Best Regards,
Péter

JS-Support
Site Admin
Posts: 684
Joined: Tue Apr 08, 2014 3:42 pm

Re: [SOLVED] a TabControl bug

Postby JS-Support » Tue Oct 11, 2016 6:07 am

Sesztak wrote:for your kind information the TabControl is better, but some other bug still exist:
...
-can you reproduce the bug ?

Hi Péter,

Thanks for your message. The TabControl in the sample Showcase application (under the "Controls" section) appears to work fine, as well as those in our tests. Could you please send me a code snippet to reproduce the issue?

Thanks.

Sesztak
Posts: 172
Joined: Fri Jun 24, 2016 2:19 am

Re: a TabControl bug

Postby Sesztak » Tue Oct 11, 2016 6:57 am

Dear JS-Support,

Do not joke with me !!: if you put only one TextBlock on a TabItem - yes, you are right !: no problem at all,

But: It's clearly written in our previous message:
""Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node."

function INTERNAL_HtmlDomManager_RemoveOptionFromNativeComboBox (optionToRemove, nativeComboBoxDomElement) {
nativeComboBoxDomElement.removeChild(optionToRemove);
};
"

So, the the the only thing you do should have to do: just put a ComboBox with some data.
(instead of asking me to do the same ! :!: )

Anyway, no problem I did the home work :D :

XAML:
<Page
x:Class="CSHTML5_removeChildOnNode_BUG.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:CSHTML5_removeChildOnNode_BUG"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Canvas>
<TabControl>
<TabItem Header="tabItem A">
<ComboBox x:Name="comboBox1" Margin="6,0,0,0" Padding="3" DisplayMemberPath="Name"/>
</TabItem>
<TabItem Header="tabItem B">
<TextBlock Text="Go back to 'tabItem A' and play with 'comboBox1' => Bug arrived ! "/>
</TabItem>
</TabControl>
</Canvas>
</Page>

C#:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace CSHTML5_removeChildOnNode_BUG
{
public partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
ObservableCollection<DataSample> _DataSample = new ObservableCollection<DataSample>() {
new DataSample() {Name ="Emil" },
new DataSample() {Name ="Peter" }
};
comboBox1.ItemsSource = _DataSample;
}

class DataSample
{
public string Name { get; set; }
}
}
}

How to reproduce the bug:
1./ First TabItem select some item from combobox,
2./ Select the other tabitem ("tabItem B"),
3./ Go back to first tabitem: you got exception.


I really hope it helps to fix the bug !

please, confirm: can you reproduce the bug ?

Waiting for your kind reply,
Br,
Péter


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest