summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAnastasia Smirnova <anasmi@utu.fi>2018-10-17 11:12:03 +0300
committerSun Zhe <31067185+ZheSun88@users.noreply.github.com>2018-10-17 11:12:03 +0300
commita52993ba9ca67c15e6ca311ca308528752b589c9 (patch)
treee5dd7ac201c7eb2f37f3ce5a644d42e3d35a7a14 /client
parente94e97444fe086cc3743289cdb9653c16816fea9 (diff)
downloadvaadin-framework-a52993ba9ca67c15e6ca311ca308528752b589c9.tar.gz
vaadin-framework-a52993ba9ca67c15e6ca311ca308528752b589c9.zip
Rebuild calendar pop-up on readOnly state change (#11249)
* Rebuild calendar pop-up on readOnly state change Fixes https://github.com/vaadin/framework/issues/6565
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java9
-rw-r--r--client/src/main/java/com/vaadin/client/ui/datefield/TextualDateConnector.java6
2 files changed, 14 insertions, 1 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java b/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java
index 8a3c6c3325..655f18669c 100644
--- a/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java
+++ b/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java
@@ -939,6 +939,15 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>>
}
/**
+ * Returns the value of initialRenderDone
+ *
+ * @since
+ */
+ public boolean isInitialRenderDone() {
+ return initialRenderDone;
+ }
+
+ /**
* For internal use only. May be removed or replaced in the future.
*
* Updates the calendar and text field with the selected dates.
diff --git a/client/src/main/java/com/vaadin/client/ui/datefield/TextualDateConnector.java b/client/src/main/java/com/vaadin/client/ui/datefield/TextualDateConnector.java
index f29a053c56..c254833d18 100644
--- a/client/src/main/java/com/vaadin/client/ui/datefield/TextualDateConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/datefield/TextualDateConnector.java
@@ -117,7 +117,7 @@ public abstract class TextualDateConnector<PANEL extends VAbstractCalendarPanel<
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
String oldLocale = getWidget().getCurrentLocale();
-
+ boolean isReadOnly = getWidget().isReadonly();
getWidget().parsable = getState().parsable;
super.onStateChanged(stateChangeEvent);
@@ -159,6 +159,10 @@ public abstract class TextualDateConnector<PANEL extends VAbstractCalendarPanel<
} else {
getWidget().calendarToggle.removeStyleName(
VAbstractPopupCalendar.CLASSNAME + "-button-readonly");
+ if (getState().readOnly != isReadOnly
+ && getWidget().calendar.isInitialRenderDone()) {
+ getWidget().calendar.renderCalendar();
+ }
}
getWidget().setDescriptionForAssistiveDevices(