Skip to content

Commit

Permalink
Fixed MaterialCollapsible setting active index with 1 as start #998 #998
Browse files Browse the repository at this point in the history
  • Loading branch information
kevzlou7979 committed Jan 15, 2021
1 parent b8e19a0 commit 60d3d21
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,13 @@ protected void clearActiveClass(HasWidgets widget) {

/**
* Open the given collapsible item.
*
* @param index the one-based collapsible item index.
*/
public void open(int index) {
setActive(index);
}

/**
* Close the given collapsible item.
*
* @param index the one-based collapsible item index.
*/
public void close(int index) {
setActive(index, false);
Expand Down Expand Up @@ -259,8 +255,8 @@ public void setActive(int index, boolean active) {
activeIndex = index;
if (isAttached()) {
if (index <= getWidgetCount()) {
if (index != 0) {
activeWidget = getWidget(index - 1);
if (index > 0) {
activeWidget = getWidget(index);
if (activeWidget != null && activeWidget instanceof MaterialCollapsibleItem) {
((MaterialCollapsibleItem) activeWidget).setActive(active);
reload();
Expand Down

0 comments on commit 60d3d21

Please sign in to comment.