diff --git a/src/feathers/controls/navigators/PageNavigator.hx b/src/feathers/controls/navigators/PageNavigator.hx index 4eddf910..ba01d102 100644 --- a/src/feathers/controls/navigators/PageNavigator.hx +++ b/src/feathers/controls/navigators/PageNavigator.hx @@ -493,7 +493,7 @@ class PageNavigator extends BaseNavigator implements IIndexSelector implements I } } if (pendingSelectedIndex != NO_PENDING_SELECTED_INDEX) { - if (pendingSelectedIndex < this._dataProvider.length) { + if (pendingSelectedIndex >= 0 && pendingSelectedIndex < this._dataProvider.length) { this._selectedIndex = pendingSelectedIndex; this._selectedItem = this._dataProvider.get(pendingSelectedIndex); } else { diff --git a/src/feathers/controls/navigators/TabNavigator.hx b/src/feathers/controls/navigators/TabNavigator.hx index a8dfe4a0..e14cb9b9 100644 --- a/src/feathers/controls/navigators/TabNavigator.hx +++ b/src/feathers/controls/navigators/TabNavigator.hx @@ -505,7 +505,7 @@ class TabNavigator extends BaseNavigator implements IIndexSelector implements ID } } if (pendingSelectedIndex != NO_PENDING_SELECTED_INDEX) { - if (pendingSelectedIndex < this._dataProvider.length) { + if (pendingSelectedIndex >= 0 && pendingSelectedIndex < this._dataProvider.length) { this._selectedIndex = pendingSelectedIndex; this._selectedItem = this._dataProvider.get(pendingSelectedIndex); } else {