What steps will reproduce the problem?
Use a tab widget, inside use any widget that uses javascript and targets the widgets' id.
Then hide the specific tab that has the javascript widget.
What's expected?
The tab should be hidden, no errors.
What do you get instead?
Errors. Since the tabs does get render, javascript gets registered but the html does not get outputted. This means the JS will not find elements it is expecting.
This is not so much a bug as a limit of the implementation.
My proposal is to allow rendering of tab widgets via a Closure:
echo Tabs::widget([
'items' => [
[
'visible' => false,
'content' => function() {
}
]
]);
A work around currently is to use an object that implements __toString() and lazily renders the tab only when __toString() gets called.
What steps will reproduce the problem?
Use a tab widget, inside use any widget that uses javascript and targets the widgets' id.
Then hide the specific tab that has the javascript widget.
What's expected?
The tab should be hidden, no errors.
What do you get instead?
Errors. Since the tabs does get render, javascript gets registered but the html does not get outputted. This means the JS will not find elements it is expecting.
This is not so much a bug as a limit of the implementation.
My proposal is to allow rendering of tab widgets via a
Closure:A work around currently is to use an object that implements
__toString()and lazily renders the tab only when__toString()gets called.