Page MenuHomePhabricator

JS error when datepicker input is mandatory
Closed, ResolvedPublic

Description

MW 1.34, PF 5.0

A form contains a datepicker field that is mandatory and only shown per a "show on select" from another field.

This produces a JS error that is easily seen in the developers console. The error is due to the JS not being able to 'focus' on the hidden field and trying to do so because it is mandatory.

The user experience is that the save button for the form does nothing.

/Rich

Event Timeline

Revansx renamed this task from Page Forms 5.0 issue when datepicker input mandatory and shown with "show on select" to Page Forms 5.0 issue when datepicker input is mandatory and shown with "show on select" .Dec 2 2020, 5:30 PM
Revansx renamed this task from Page Forms 5.0 issue when datepicker input is mandatory and shown with "show on select" to Page Forms 5.0 issue when datepicker input is mandatory and hidden with "show on select" .
Aklapper renamed this task from Page Forms 5.0 issue when datepicker input is mandatory and hidden with "show on select" to JS error when datepicker input is mandatory and hidden with "show on select".Dec 2 2020, 5:41 PM

@Revansx: Hi, I assume this is about Page Forms, so I added the project tag so someone can find this task. Please correct me if I was wrong. :)

Yaron_Koren renamed this task from JS error when datepicker input is mandatory and hidden with "show on select" to JS error when datepicker input is mandatory.Dec 2 2020, 7:39 PM
Yaron_Koren subscribed.

It's actually worse than we thought - I'm pretty sure it's unrelated to "show on select", and just happens whenever a datepicker input is made mandatory.

bummer. good luck and thank you for your continued efforts.

Change 644821 had a related patch set uploaded (by Yaron Koren; owner: Yaron Koren):
[mediawiki/extensions/PageForms@master] Fix for mandatory datepicker, datetimepicker inputs

https://gerrit.wikimedia.org/r/644821

Change 644821 merged by jenkins-bot:
[mediawiki/extensions/PageForms@master] Fix for mandatory datepicker, datetimepicker inputs

https://gerrit.wikimedia.org/r/644821

Is the fix mentioned above the solution? Is it pulled into PF master?

Yes, although it turned out not to be a complete solution. I just checked in what I think is the other part of the fix, so now if you get the latest code, hopefully everything will work.

Yaron_Koren claimed this task.