Skip to content

Commit 55c66df

Browse files
committed
fix #188: prevent flickering also for date/time-picker
1 parent a6fc0b2 commit 55c66df

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

client/django-formset/DateTime.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,11 @@ class DateTimeField extends Widget {
495495
}
496496

497497
public initialize() {
498+
if (this.calendar) {
499+
// to prevent flickering when loading the page, the popup dialog is hidden
500+
this.calendar.element.style.visibility = '';
501+
}
502+
498503
// some styles change when switching light/dark mode, so we need to update them
499504
StyleHelpers.pushMediaQueryStyles([[
500505
this.styleSheet,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% include "django/forms/widgets/input.html" %}
22
{% if calendar %}
3-
<div role="dialog" class="dj-calendar" aria-label="calendar">
3+
<div role="dialog" class="dj-calendar" aria-label="calendar" style="visibility: hidden;">
44
{% include calendar.template %}
55
</div>
66
{% endif %}

0 commit comments

Comments
 (0)