<polymer-element name="b-secret">
<template>
<div>Other things here</div>
<input id="password-field" type="password" value="{{value}}">
</template>
<script type="application/dart" src="secret.dart"></script>
</polymer-element>+w...@dartlang.org, John
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/d7a1192a-4520-4b0d-869f-88c8f524e841%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
ShadowDOMPolyfill.wrap(document.activeElement)
// might need a `new JsObject.fromBrowserObject()` around the method arg, not sure
context['ShadowDOMPolyfill'].callMethod('wrap', [document.activeElement]);
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CAJup4OXw7xwUt5TjB6sodnT6JKV%2B7SKUavK%3Ds25S_goaUza0BQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CAJj5OwCUOQqfJYhaPafZZbaf6pJCGHcBVguYFnKAdLdNUKCSCg%40mail.gmail.com.
bool isActive() {
var passwordField = $['password-field'];
var activeElement = js.context.callMethod('wrap', [document.activeElement]);
// For Browsers with shadow DOM support the shadowRoot.host matches while
// for Browsers without shadow DOM support the password field match.
if (activeElement.hashCode != hashCode &&
activeElement.hashCode != passwordField.hashCode) {
return false;
} else {
return true;
}
}