mirror of https://github.com/zulip/zulip.git
settings: Open the date picker when its label has been clicked.
Flatpickr isn't a native input element, so clicking on its label doesn't do anything. Add an event listener so that clicking on the label will open the date picker. Fixes part of #21769.
This commit is contained in:
parent
4ab519214a
commit
e237faabf5
|
@ -170,6 +170,13 @@ export function initialize_custom_date_type_fields(element_id: string): void {
|
||||||
static: true,
|
static: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Enable the label associated to this field to open the datepicker when clicked.
|
||||||
|
$(element_id)
|
||||||
|
.find(".custom_user_field label.settings-field-label")
|
||||||
|
.on("click", function () {
|
||||||
|
$(this).closest(".custom_user_field").find("input.datepicker").trigger("click");
|
||||||
|
});
|
||||||
|
|
||||||
$(element_id)
|
$(element_id)
|
||||||
.find<HTMLInputElement>(".custom_user_field input.datepicker")
|
.find<HTMLInputElement>(".custom_user_field input.datepicker")
|
||||||
.on("mouseenter", function () {
|
.on("mouseenter", function () {
|
||||||
|
|
Loading…
Reference in New Issue