Skip to content

Commit 60d3d21

Browse files
committed
Fixed MaterialCollapsible setting active index with 1 as start #998 #998
1 parent b8e19a0 commit 60d3d21

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollapsible.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,13 @@ protected void clearActiveClass(HasWidgets widget) {
187187

188188
/**
189189
* Open the given collapsible item.
190-
*
191-
* @param index the one-based collapsible item index.
192190
*/
193191
public void open(int index) {
194192
setActive(index);
195193
}
196194

197195
/**
198196
* Close the given collapsible item.
199-
*
200-
* @param index the one-based collapsible item index.
201197
*/
202198
public void close(int index) {
203199
setActive(index, false);
@@ -259,8 +255,8 @@ public void setActive(int index, boolean active) {
259255
activeIndex = index;
260256
if (isAttached()) {
261257
if (index <= getWidgetCount()) {
262-
if (index != 0) {
263-
activeWidget = getWidget(index - 1);
258+
if (index > 0) {
259+
activeWidget = getWidget(index);
264260
if (activeWidget != null && activeWidget instanceof MaterialCollapsibleItem) {
265261
((MaterialCollapsibleItem) activeWidget).setActive(active);
266262
reload();

0 commit comments

Comments
 (0)