Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#9179 closed bug (notabug)

Accordion doesn't open active panel

Reported by: greg.wacker Owned by:
Priority: minor Milestone: none
Component: ui.accordion Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

Description

http://jsfiddle.net/ghvZF/

Regression: Example works in 1.9.x for all browsers, but not 1.10.x

Panel 2 should default to open.

Change History (2)

comment:1 Changed 7 years ago by tj.vantoll

Resolution: notabug
Status: newclosed

Hi greg.wacker,

Thanks for taking the time to contribute to the jQuery UI project. This was an intentional change made in 1.10 (http://jqueryui.com/upgrade-guide/1.10/#removed-support-for-non-number-falsey-values-for-active-option). You can use a number to accomplish this: http://jsfiddle.net/tj_vantoll/EYCv2/.

comment:2 in reply to:  1 Changed 7 years ago by greg.wacker

Replying to tj.vantoll:

Hi greg.wacker,

Thanks for taking the time to contribute to the jQuery UI project. This was an intentional change made in 1.10 (http://jqueryui.com/upgrade-guide/1.10/#removed-support-for-non-number-falsey-values-for-active-option). You can use a number to accomplish this: http://jsfiddle.net/tj_vantoll/EYCv2/.

Thank you for the quick response and example.

That's an unfortunate change to me. I can no longer use a scripting language to dynamically alter classes to determine which panel opens on page load. I now have to break my JavaScript out of a .js file (minified) at some level and instead write dynamic inline JavaScript depending on a user action, which is something I typically try to avoid.

I understand the urge to simplify the UI code base and it's all about where that line is drawn for library performance/size vs features, but I also wanted to point out why some people might find this option pretty useful.

edit: I take last part back to an extent... I guess I can come up with the index based on my active class name in my static .js file just as you had before. More code, but I'm guessing it's not a often used method to warrant adding to the library.

http://jsfiddle.net/Wyt4Z/2/

Last edited 7 years ago by greg.wacker (previous) (diff)
Note: See TracTickets for help on using tickets.