Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should common-panel-set element have selectedIndex? #5

Open
bkardell opened this issue Jan 8, 2015 · 2 comments
Open

Should common-panel-set element have selectedIndex? #5

bkardell opened this issue Jan 8, 2015 · 2 comments

Comments

@bkardell
Copy link
Owner

bkardell commented Jan 8, 2015

It seems like an obvious sort of add, select boxes (another kind of single-select mechanism) have this, as do most implementations of tabs, decks and accordions. If so it'd be reflected so you could do

myPanelSet.selectedIndex = 4;

And it would update the attribute and do the right thing. I didn't start with that because there are numerous cases where that sort of API is clunkier than dealing with element references you'd get another way, but I can definitely see it's utility.

@LJWatson
Copy link
Collaborator

The idea being that you could select a specific panel to be displayed by default? Makes sense to me.

@bkardell
Copy link
Owner Author

@LJWatson no, you can do that in markup with the expansion state today and using an index to set via markup is markedly harder... the idea being that you could read this attribute or read/write the runtime javascript property to say "select the third one". We basically have to track this internally anyway and that's functionally how it's managed, so exposing it seems kind of non-harmful and I can imagine some cases where it could be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants