Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Can polymer-selector do an initial check for active #2

Open
robdodson opened this issue Mar 17, 2014 · 0 comments
Open

Can polymer-selector do an initial check for active #2

robdodson opened this issue Mar 17, 2014 · 0 comments

Comments

@robdodson
Copy link

In some situations it's easier to set a menu item as active instead of setting a selected index. For example, here's some markup from the Polymer site:

<dropdown-panel>
  <polymer-ui-menu-item
    src="/images/picons/ic_guide_dark_.png"
    label="Start"
    href="/docs/start/getting-the-code.html"
    {% if page.navgroup == 'start' %}active{% endif %}>
  </polymer-ui-menu-item>

  <polymer-ui-menu-item
    src="/images/picons/ic_book_dark_.png"
    label="Docs"
    href="/docs/polymer/polymer.html"
    {% if page.navgroup == 'docs' %}active{% endif %}>
  </polymer-ui-menu-item>

  <polymer-ui-menu-item
    src="/images/picons/ic_feedback_dark_.png"
    label="Resources"
    href="/resources/faq.html"
    {% if page.navgroup == 'resources' %}active{% endif %}>
  </polymer-ui-menu-item>

  <polymer-ui-menu-item
    src="/images/picons/ic_people_dark.png"
    label="Community"
    href="/discuss.html"
    {% if page.navgroup == 'community' %}active{% endif %}>
  </polymer-ui-menu-item>
</dropdown-panel>

Is it possible for polymer-selector to do an initial check of its children to determine which item is selected? Without this check, if I assign another item as selected it will not remove the original active attribute and I end up with two active items.

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

No branches or pull requests

1 participant