-
So I'm using an sl-tab-group as per the documentation, and I would like to determine which is the currently active tab, and store that off so that when I come back to the page (after a refresh, say) that I can ensure that the same tab is open for the user. In looking at the docs and hacking around a bit, it appears that both the sl-tab and the sl-tab-panel have an "active" property, that seems to be what I'm looking for. Which is better form ... setting the sl-tab's "active" property (in which case I should store off the "panel" property value to remember it when I come back, or setting the sl-tab-panel's "active" property (in which case I should store off the "name" property to find it when I come back)? Or does it matter? UPDATE: Curiouser and curiouser... I just took a stab at it and if I set the "active" property programmatically on the sl-tab-panel, it doesn't update the tabs, although BOTH the currently active tab panel and the one I activated programmatically now show as having the "active" property. That doesn't seem right.... Here's a codepen: https://codepen.io/ourson66/pen/gbYPGZj?editors=1000 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The fix for this was actually just merged yesterday: #2299 So getting/setting the |
Beta Was this translation helpful? Give feedback.
The fix for this was actually just merged yesterday: #2299
So getting/setting the
active
property will work fine in the next release.