Skip to content

Tabs: set first visible tab as active if not active set #186

@nilsburg

Description

@nilsburg

What steps will reproduce the problem?

echo \yii\bootstrap\Tabs::widget([
        'items'=>[
            [
                'label'       => 'Tab 1',
                'content'     => 'some content',
                'visible'     => false
            ],
            [
                'label'       => 'Tab 2',
                'content'     => 'some content',
                'visible'     => true
            ],
            [
                'label'       => 'Tab 3',
                'content'     => 'some content',
                'visible'     => true
            ],
        ]
    ]);

What's expected?

Tab 2 should be active

What do you get instead?

No active tab.
I am not sure if this is on purpose, but I think that if no active tab is set, the first visible tab should be active.

Additional info

Q A
Yii vesion 2.0.11.2
PHP version 5.6
Operating system Ubuntu 16.04

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions