Opened 8 years ago

Closed 8 years ago

#12748 closed defect (fixed)

[patch] [ccla] ScrollingTabController doesn't properly select child before started

Reported by: Brian Arnold Owned by: bill
Priority: high Milestone: 1.7
Component: Dijit Version: 1.6.0
Keywords: Cc:
Blocked By: Blocking:

Description

We've observed that when a tab container was created (either declaratively or programmatically) that if a tab was selected that would be outside of initial scroll position, that it wouldn't show the tab properly. Later tab selections would cause the scroll properly, but it wasn't happening prior to startup.

Looking through the code, it appears that the ScrollingTabController?'s _selectedTab properly was only being set if _postResize were true. Adjusting it to properly set _selectedTab and then only execute the smooth scroll if _postResize is true.

I've attached a small patch that was written against r24446 of dijit's trunk, as well as a couple of example files that work against 1.6.0 on Google CDN, and have tested this code against Chrome 10, Firefox 4, and IE8. This work falls under SitePen?'s CCLA.

Attachments (3)

scrollingtabcontroller.patch (1.1 KB) - added by Brian Arnold 8 years ago.
Patch to ScrollingTabController? to properly set selected tab
example.html (1.7 KB) - added by Brian Arnold 8 years ago.
Example of a selected tab not showing properly
example_patched.html (2.7 KB) - added by Brian Arnold 8 years ago.
Example of applying this patch to ScrollingTabController?'s prototype (using safeMixin so that this.inherited works)

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by Brian Arnold

Patch to ScrollingTabController? to properly set selected tab

Changed 8 years ago by Brian Arnold

Attachment: example.html added

Example of a selected tab not showing properly

Changed 8 years ago by Brian Arnold

Attachment: example_patched.html added

Example of applying this patch to ScrollingTabController?'s prototype (using safeMixin so that this.inherited works)

comment:1 Changed 8 years ago by Tom Trenka

[ccla] designation is from SitePen?, Inc.

comment:2 Changed 8 years ago by bill

Thanks for the patch and test file. Unfortunately the patch causes a failure in the dijit/test/layout/TabContainer.html test file (before adding a new test for this ticket).

comment:3 Changed 8 years ago by bill

Milestone: tbd1.7
Owner: set to bill
Status: newassigned

Hmm, actually nevermind, it's not happening for me anymore, I guess it's an intermittent failure. I'll check in your fix, thanks.

comment:4 Changed 8 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [24448]) Fix initial scroll position of ScrollableTabController, thanks to brianarn for patch, fixes #12748 !strict.

Note: See TracTickets for help on using tickets.