New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partial View scripts only rendering for first form when using multiple forms #670
Comments
I'm not able to replicate this I'm afraid. Maybe you can see if I'm doing anything different to you? I've tried with two copies of the same form on a page, or two different forms - in both cases with each form having a single date field. I find I can use the date picker as expected on both forms.
Have also tried with and without the extra link you've added to clear the TempData. |
The first form rendered on the page needs to be without a date field. |
I see... and yes, I can replicate that. On V8 too so seems to be an existing bug. Looks like we need to be more precise in the checks to prevent rendering the same scripts and CSS files twice - currently it's doing so only for the first form, but it needs to be doing so for every form, de-duplicating any scripts or stylesheets already rendered from the forms before. |
This behaviour has been amended now such that the de-duplication applies at the level of the file rather than the form, which should resolve this issue. Due in 8.10.0 and 9.2.0. |
I think this may a bit of an edge case but I noticed that if you render multiple forms on a page, if a form has a field type which requires a partial view that adds script dependencies (like DatePicker.cshtml), only the script references for the first form are added to the page.
There is a workaround of moving the script references into the field type partial view (e.g. FieldType.DatePicker.cshtml) but the fact the DatePicker partial contains these, suggests it should work out of the box.
Specifics
Umbraco Forms 9.0.1 (issue also found in Forms 8.9.0).
Steps to reproduce
Create two forms, one with a datepicker field and one without.
Render the two forms on the same page ensuring the datepicker form is last.
Attempt to click on the datepicker field.
Ensure you render scripts at the bottom of the page.
*As a side note, I have the following code snippet as TempData was not being cleared when I visited a different page (maybe a different bug?)
Expected result
Datepicker calendar to show.
Actual result
Calendar not showing.
The text was updated successfully, but these errors were encountered: