Skip to content

Commit

Permalink
fix: workaround Polymer getProperty with mixins/observers (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomivirkki committed Jun 25, 2020
1 parent 8811ef6 commit ccf8e8c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/vaadin-text-field-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,15 @@
}
}

// Workaround for https://github.com/Polymer/polymer/issues/5259
get __data() {
return this.__dataValue || {};
}

set __data(value) {
this.__dataValue = value;
}

/**
* Fired when the user commits a value change.
*
Expand Down
16 changes: 16 additions & 0 deletions test/integer-field.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
</template>
</test-fixture>

<test-fixture id="mixed">
<template>
<vaadin-integer-field label="integer fld"></vaadin-integer-field>
<vaadin-text-field label="text fld"></vaadin-text-field>
<vaadin-number-field label="number fld"></vaadin-number-field>
</template>
</test-fixture>

<script>
describe('integer-field', () => {

Expand Down Expand Up @@ -229,6 +237,14 @@
});

});

describe('mixed', () => {

it('should work together with text-field and number-field', () => {
expect(() => fixture('mixed')).to.not.throw(Error);
});

});
</script>
</body>

Expand Down

0 comments on commit ccf8e8c

Please sign in to comment.