You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Item Petitions in dropdown must not have active css
What do you get instead?
dropdown item has css attribute class="active"
Additional info
original code:
protected function isChildActive($items, &$active)
{
foreach ($items as $i => $child) {
if (ArrayHelper::remove($items[$i], 'active', false) || $this->isItemActive($child)) {
Html::addCssClass($items[$i]['options'], 'active');
if ($this->activateParents) {
$active = true;
}
}
}
return $items;
}
Condition in line if (ArrayHelper::remove($items[$i], 'active', false) || $this->isItemActive($child)) {
is not correct. Problem is of using operator ||
| Yii version | 2.0
| PHP version | 5.6
| Operating system | windows 7
The text was updated successfully, but these errors were encountered:
This issue has originally been reported by @poluda at yiisoft/yii2#13748.
Moved here by @samdark.
What steps will reproduce the problem?
$menuItem='posts';
echo Nav::widget([
'items' => [
['label' => 'Posts', 'url' => ['/posts/index'], 'active' => $menuItem == 'posts'],
['label' => 'Services', 'active' => $menuItem == 'services', 'items' => [
['label' => 'Petitions', 'url' => ['/petitions/index'], 'active' => false],
]],
],
'activateItems'=>true,
'encodeLabels' => false,
'options' => ['class' => 'nav navbar-nav'],
]);
What is the expected result?
The Item Petitions in dropdown must not have active css
What do you get instead?
dropdown item has css attribute class="active"
Additional info
original code:
protected function isChildActive($items, &$active)
{
foreach ($items as $i => $child) {
if (ArrayHelper::remove($items[$i], 'active', false) || $this->isItemActive($child)) {
Html::addCssClass($items[$i]['options'], 'active');
if ($this->activateParents) {
$active = true;
}
}
}
return $items;
}
Condition in line if (ArrayHelper::remove($items[$i], 'active', false) || $this->isItemActive($child)) {
is not correct. Problem is of using operator ||
| Yii version | 2.0
| PHP version | 5.6
| Operating system | windows 7
The text was updated successfully, but these errors were encountered: