From 28af3ba9a2c9318663d7370d9d64b93fd459ad2d Mon Sep 17 00:00:00 2001 From: Phan Hong Duc Date: Wed, 18 Mar 2020 09:55:50 +0200 Subject: [PATCH] fix: reflect readonly property to attribute (#134) --- src/vaadin-time-picker.html | 3 ++- test/input-test.html | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vaadin-time-picker.html b/src/vaadin-time-picker.html index 3c51d3a..65d24b0 100644 --- a/src/vaadin-time-picker.html +++ b/src/vaadin-time-picker.html @@ -218,7 +218,8 @@ */ readonly: { type: Boolean, - value: false + value: false, + reflectToAttribute: true }, /** diff --git a/test/input-test.html b/test/input-test.html index 564bbf3..ea74075 100644 --- a/test/input-test.html +++ b/test/input-test.html @@ -205,6 +205,11 @@ }); }); + it('should reflect to attribute when readonly property is set', () => { + timePicker.readonly = true; + expect(timePicker.hasAttribute('readonly')).to.be.true; + }); + describe('aria', () => { it('text-field should have the `aria-label` attribute', () => { expect(timePicker.__inputElement.hasAttribute('aria-label')).to.be.false;