update components

This commit is contained in:
Luke Pulverenti 2016-05-05 14:29:30 -04:00
parent 25b5198fa7
commit e5a4b3813f
21 changed files with 360 additions and 87 deletions

View file

@ -1,6 +1,6 @@
{
"name": "iron-behaviors",
"version": "1.0.14",
"version": "1.0.15",
"description": "Provides a set of behaviors for the iron elements",
"private": true,
"authors": [
@ -30,11 +30,11 @@
},
"ignore": [],
"homepage": "https://github.com/PolymerElements/iron-behaviors",
"_release": "1.0.14",
"_release": "1.0.15",
"_resolution": {
"type": "version",
"tag": "v1.0.14",
"commit": "c1d38a26219cf2e83b31a71a2bd8ae35ebee7ed7"
"tag": "v1.0.15",
"commit": "f91583bfae24235401a21a1d67bde8cacce13030"
},
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
"_target": "^1.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "iron-behaviors",
"version": "1.0.14",
"version": "1.0.15",
"description": "Provides a set of behaviors for the iron elements",
"private": true,
"authors": [

View file

@ -73,7 +73,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
if (event.target === this) {
this._setFocused(event.type === 'focus');
} else if (!this.shadowRoot && !this.isLightDescendant(event.target)) {
} else if (!this.shadowRoot &&
!this.isLightDescendant(Polymer.dom(event).localTarget)) {
this.fire(event.type, {sourceEvent: event}, {
node: this,
bubbles: event.bubbles,

View file

@ -31,10 +31,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
<test-fixture id="LightDOM">
<test-fixture id="LightDOM">
<template>
<test-light-dom>
<input id="input">
<nested-focusable></nested-focusable>
</test-light-dom>
</template>
</test-fixture>
@ -119,11 +120,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
suite('elements in the light dom', function() {
var lightDOM, input;
var lightDOM, input, lightDescendantShadowInput;
setup(function() {
lightDOM = fixture('LightDOM');
input = document.querySelector('#input');
lightDescendantShadowInput = Polymer.dom(lightDOM)
.querySelector('nested-focusable').$.input;
});
test('should not fire the focus event', function() {
@ -138,6 +141,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
expect(nFocusEvents).to.be.equal(0);
});
test('should not fire the focus event from shadow descendants', function() {
var nFocusEvents = 0;
lightDOM.addEventListener('focus', function() {
nFocusEvents += 1;
});
MockInteractions.focus(lightDescendantShadowInput);
expect(nFocusEvents).to.be.equal(0);
});
});
</script>