- Issue created by @dieterholvoet
- Merge request !4Issue #3390435: Check for duplicates on text field blur instead of during typing β (Open) created by dieterholvoet
- Status changed to Needs review
about 1 year ago 1:24pm 28 September 2023 - Status changed to Needs work
about 1 year ago 10:35pm 8 October 2023 - π³π΄Norway matsbla
Thank you for this effort. I do see the problem. However one challenges with this patch is when the user want to only change the title and click on "save" button before the title field is unfocused. When I tried that the title field becomes empty and I get an error message stating that the title field is required. Please check an earlier bug π Title changes not submitted via AJAX Post in some cases Fixed when you could actually save the node before the duplicates are checked leading to new title being lost. I think this is where the problem you try to address was introduced, but it also needs to be possible to save the node without unfocusing the title first
- πΊπΈUnited States 3cwebdev
Tested and had to remove the patch as it was not saving title changes made if the title field focus was never left.
- π§πͺBelgium dieterholvoet Brussels
A workaround for this issue on the field config form was added to core recently ( π Race condition on AJAX change event and form submission Fixed ) and a follow-up to find a more general fix was opened after ( π Find a generic way to resolve race condition on AJAX change event and form submission Active ). I'll adapt that workaround to our situation, disabling the submit button when focusing the title field and re-enabling it after the AJAX request finishes.
- π§πͺBelgium dieterholvoet Brussels
I'll also change the
.node-form .form-submit
selector to.page-wrapper .form-submit
. This is necessary when using Gin theme, since it moves the submit button outside the form. - Status changed to Needs review
12 months ago 9:49pm 4 December 2023 - Status changed to Postponed: needs info
7 months ago 4:43pm 1 May 2024 - π³π΄Norway matsbla
> duplicates are checked during typing in the title field.
I tested now and it seems like it is only checked when the title field is unfocused - am I missing something?
> disabling the submit button when focusing the title field
Am not sure if this is the best solution. What happens if the user only want to change the title, make changes without unfocusing the title field, and then doesn't understand why the submit button is disabled?
- π§πͺBelgium dieterholvoet Brussels
I tested now and it seems like it is only checked when the title field is unfocused - am I missing something?
Yes, that's the whole point of the issue: to check for duplicates on text field blur (= unfocus) instead of during typing. See my reasoning in the issue description.
Am not sure if this is the best solution.
This is the solution core adopted in π Race condition on AJAX change event and form submission Fixed until a more general solution is available and I must say, after using it a while in production. I like it. The problem hasn't happened again since.
- π³π΄Norway matsbla
The problems is when the user only want to change the title, make changes without unfocusing the title field, and then doesn't understand why the submit button is disabled. This solution will solve one UI challenges by introducing a new one.
Instead of disabeling the button, could we make sure that if title is still unfocused, that we run the anti-duplicate check when user click submit, before we process the submit button action?
- Status changed to Needs work
7 months ago 8:46pm 5 May 2024 - π§πͺBelgium dieterholvoet Brussels
That approach sounds good! I'm not sure if I'll have the time to implement this anytime soon though.