View Issue Details

IDProjectCategoryView StatusLast Update
0001751NoesisGUIC# SDKpublic2020-07-09 13:54
Reporterai_enabledAssigned Tosfernandez 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.0.1 
Target Version3.0.3Fixed in Version3.0.3 
Summary0001751: TabControl selection issue
DescriptionHi guys,

I have an odd bug with TabControl that took me over 2 hours to investigate.
It seems when I change the active tab by ANY way (e.g. tabControl.SelectedIndex, or SelectedItem, or through tabItem.IsSelected Binding), visually everything is changed as expected. However, the previously selected tab cannot be clicked. No effect until I manually click on any other tab to move the select, then I'm able to click on the previously selected tab. It seems there is something odd going on in the TabControl internal state. See the steps to reproduce.

Regards!
Steps To Reproduce1. create tab control with two tabs
2. make that second tab is selected programmatically by some action
3. start application, select first tab. Perform action to select second tab.
4. try to select the first tab. Selection doesn't change!

I guess TabControl internal state assumes that the first tab is still selected.
A workaround is simple and 100% efficient—just reset the visual state of the tab control when its selected tab is changed:
this.tabControl.Visibility = Visibility.Collapsed;
this.tabControl.UpdateLayout();
this.tabControl.Visibility = Visibility.Visible;

TagsNo tags attached.
PlatformAny

Activities

sfernandez

sfernandez

2020-07-08 18:09

manager   ~0006517

Maybe I'm missing something, but the tests I'm doing using bindings are working: https://www.noesisengine.com/xamltoy/e6d84aa593deb24eaf275bd77c38dc6b
Anything different from your scenario in that test?
ai_enabled

ai_enabled

2020-07-08 18:13

updater   ~0006518

Last edited: 2020-07-08 18:16

View 4 revisions

I'm not sure if it's possible to reproduce this bug only with XAML.
The issue involves programmatically (in C# codebehind) changing the selected tab (either via TabControl SelectedIndex or by TabControl SelectedItem, or by changing TabItem IsSelected property) as I've mentioned in the steps to reproduce.

ai_enabled

ai_enabled

2020-07-08 18:17

updater   ~0006519

I can also reproduce the issue with MVVM data binding but I was able to isolate it to just C# codebehind code that changes SelectedIndex of the tab control.
I've investigated whether it might be style/template-related but it seems to be not the case.
sfernandez

sfernandez

2020-07-08 18:36

manager   ~0006520

Do the tabs need to be generated from data to reproduce the issue, or can they be TabItems defined in the xaml?
ai_enabled

ai_enabled

2020-07-08 19:53

updater   ~0006522

Last edited: 2020-07-08 19:53

View 2 revisions

The TabItems are defined in XAML.

Issue History

Date Modified Username Field Change
2020-07-07 14:40 ai_enabled New Issue
2020-07-08 11:27 jsantos Assigned To => sfernandez
2020-07-08 11:27 jsantos Status new => assigned
2020-07-08 11:27 jsantos Target Version => 3.0.3
2020-07-08 18:09 sfernandez Status assigned => feedback
2020-07-08 18:09 sfernandez Note Added: 0006517
2020-07-08 18:13 ai_enabled Note Added: 0006518
2020-07-08 18:13 ai_enabled Status feedback => assigned
2020-07-08 18:13 ai_enabled Note Edited: 0006518 View Revisions
2020-07-08 18:15 ai_enabled Note Edited: 0006518 View Revisions
2020-07-08 18:16 ai_enabled Note Edited: 0006518 View Revisions
2020-07-08 18:17 ai_enabled Note Added: 0006519
2020-07-08 18:36 sfernandez Status assigned => feedback
2020-07-08 18:36 sfernandez Note Added: 0006520
2020-07-08 19:53 ai_enabled Note Added: 0006522
2020-07-08 19:53 ai_enabled Status feedback => assigned
2020-07-08 19:53 ai_enabled Note Edited: 0006522 View Revisions
2020-07-09 13:54 sfernandez Status assigned => resolved
2020-07-09 13:54 sfernandez Resolution open => fixed
2020-07-09 13:54 sfernandez Fixed in Version => 3.0.3