Opened 5 years ago

Closed 5 years ago

#10126 closed bug (notabug)

Accordion: Appending new items with all panels closed via 'active: none' opens added panel

Reported by: jcwren Owned by:
Priority: minor Milestone: none
Component: ui.accordion Version: 1.10.4
Keywords: Cc:
Blocked by: Blocking:

Description

If a set of panels is created with 'active: none' set, and a new panel is appended and the accordion refreshed, the new panel is opened. If another panel is already opened, then the new panel is not opened. The 'refresh' method appears to not be honoring the configured 'active' setting.

Demonstration -- http://jsfiddle.net/jcwren/MGKMH/

Change History (6)

comment:1 Changed 5 years ago by tj.vantoll

Status: newopen
Summary: Appending new items with all panels closed via 'active: none' opens added panelAccordion: Appending new items with all panels closed via 'active: none' opens added panel

Confirmed against master: http://jsfiddle.net/tj_vantoll/MGKMH/2/

comment:2 Changed 5 years ago by jperrault

I spoke with @scott_gonsalez in #jqueryui-dev, and the behavior described in this ticket seems to be the expected behavior.

comment:3 in reply to:  2 Changed 5 years ago by jcwren

Replying to jperrault:

I spoke with @scott_gonsalez in #jqueryui-dev, and the behavior described in this ticket seems to be the expected behavior.

Well, that's... disappointing. And seemingly insane. It's easier to programmatically open it than have to find it and close it.

comment:4 Changed 5 years ago by jperrault

Scott also mentioned that 'active: none' is an invalid value, it should be 'active: false'. With the false setting, your first scenario results in the header remaining closed.

comment:5 in reply to:  4 Changed 5 years ago by jcwren

Replying to jperrault:

Scott also mentioned that 'active: none' is an invalid value, it should be 'active: false'. With the false setting, your first scenario results in the header remaining closed.

I guess that's the danger in trusting an accepted answer from StackOverlow.

http://stackoverflow.com/questions/2675263/collapse-all-sections-in-accordian-on-page-load-in-jquery-accordian

comment:6 Changed 5 years ago by Scott González

Resolution: notabug
Status: openclosed

Here is a fiddle showing it working properly: http://jsfiddle.net/MGKMH/3/

Note: See TracTickets for help on using tickets.