Closed KittyGiraudel closed 8 years ago
@HugoGiraudel, that was quick!
All tabs are now rendered and hidden except the visible one
Can there be an option to render the non-visible tabs on click rather than by default?
I am not sure what you mean. Right now, only the selected tab is displayed, the others are hidden.
I think @oyeanuj means not pre-rendering the tabs that are not yet shown. For example if there is an image/component in tab 2, and tab 1 is loaded by default, then the network request for the image in tab 2 would be deferred until clicking that tab.
PR looks good :+1:
I think @oyeanuj means not pre-rendering the tabs that are not yet shown. For example if there is an image/component in tab 2, and tab 1 is loaded by default, then the network request for the image in tab 2 would be deferred until clicking that tab.
It is. This is how browsers work already.
Naw dude! Set the default visibleIndex
to 2 and look at your network requests in Chrome!
Yes, I was referring to the case of pre-rendering tab content before the tab is clicked. It can be a problem if there are a lot of network fetching, rendering and loading to do in different tabs and they all get rendered at the same time.
This PR is a bit brutal and might need to bump major version as it can be considered as backward incompatible. Here are the changes:
<button>
inside<li>
id
,role
,tabindex
,aria-controls
,aria-labelledby
,aria-selected
attributesindex
askey
as it is an anti-patternTab
)Panel