From 2149202e10fbb2ea4238de22d41b94ca7d2d45c1 Mon Sep 17 00:00:00 2001 From: Yvonne Yip Date: Wed, 16 Jul 2014 16:32:31 -0700 Subject: [PATCH] support tabindex on core-input and tabbing forwards --- core-input.html | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/core-input.html b/core-input.html index 525556b..4d4ab98 100644 --- a/core-input.html +++ b/core-input.html @@ -78,18 +78,18 @@ --> - + @@ -227,7 +227,11 @@ */ invalid: false, }, - + + ready: function() { + this.tabindexChanged(this.getAttribute('tabindex')); + }, + validateValue: function() { var valid = true; @@ -269,6 +273,20 @@ this.validateValue(); }, + attributeChanged: function(attr, oldVal, curVal) { + if (attr === 'tabindex') { + this.tabindexChanged(curVal); + } + }, + + tabindexChanged: function(tabindex) { + if (tabindex > 0) { + this.$.input.setAttribute('tabindex', -1); + } else { + this.$.input.removeAttribute('tabindex'); + } + }, + /** * Commits the inputValue to value. * @@ -287,11 +305,15 @@ }, focusAction: function() { + this.$.input.focus(); + }, + + inputFocusAction: function() { // re-fire non-bubbling event this.fire('focus', null, this, false); }, - blurAction: function() { + inputBlurAction: function() { // re-fire non-bubbling event this.fire('blur', null, this, false); }