Skip to content
This repository was archived by the owner on May 15, 2023. It is now read-only.

Commit 06f1b76

Browse files
committed
fixed issue #56 - invalid property does not update
1 parent bb3c2a2 commit 06f1b76

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

gold-cc-input.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,10 @@
236236
}
237237
this.cardType = valid ? result.card_type.name : '';
238238

239+
// Update invalid property
240+
this.invalid = !valid;
241+
239242
// Update the container and its addons (i.e. the custom error-message).
240-
this.$.container.invalid = !valid;
241243
this.$.container.updateAddons({
242244
inputElement: this.$.input,
243245
value: this.value,

test/basic.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@
153153
assert.equal(ironInput.selectionEnd, 2, 'selectionEnd is preserved');
154154
});
155155

156+
test('validate method should update invalid property', function() {
157+
var input = fixture('required');
158+
input.value = '1111 1111';
159+
input.validate();
160+
assert.isTrue(input.invalid);
161+
});
162+
156163
});
157164

158165
suite('a11y', function() {

0 commit comments

Comments
 (0)