Closed (fixed)
Project:
Editable Fields
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Apr 2010 at 19:34 UTC
Updated:
15 Jun 2011 at 16:41 UTC
Jump to comment: Most recent
Comments
Comment #1
markfoodyburton commentedjanvandiepen added it, but - I am not at all sure I understand why?
http://drupalcode.org/viewvc/drupal/contributions/modules/editablefields...
I wonder if it was there for testing purposes initially?
Maybe we should simply remove it altogether?
Hopefully Jan can comment...
Cheers
Mark.
Comment #2
Jan van Diepen commentedTo be honest, I hadn't even noticed it and it was certainly not done on purpose.
The 3 lines of code were put there to replace some code (also used for focusing) in Drupal.editablefields.init and Drupal.editablefields.load.
See: http://drupalcode.org/viewvc/drupal/contributions/modules/editablefields...
The focusing was originally added to solve issue #556194: Fields not showing if value doesn't exist. by giving an empty field focus after clicking its label.
If removing the 3 lines of code will not break the intended focusing/blurring behavior of the fields, then please go ahead and remove it permanently.
Appreciate the feedback though. So thanks for that mikestefff.
Comment #3
markfoodyburton commentedMikestefff, can you give this a good test and report back?
Cheers
Mark.
Comment #4
mstef commentedWhat exactly am I testing? If an empty field like a text box still appears without focusing? I don't see how calling focus() on an element would affect that.
Comment #5
markfoodyburton commentedI dont know ! - Jan?
Comment #6
Jan van Diepen commentedSorry for not responding earlier.
We need the focusing (and blurring) behavior for the implementation of collapsing fields. The label was made click-able to allow focus to be set to an empty (invisible) field that goes with it.
The original code that was used to do the focusing was removed from Drupal.editablefields.html_init() and Drupal.editablefields.load() and replaced by some code in Drupal.behaviors.editablefields() in editablefields.js. Drupal.behaviors is a funny thing. In our case it should attach (but not execute) the focusing behavior to the editablefields on initialisation. Somehow it also executes that behavior on a page when opening it, hence the displacement.
What should be tested is if the patch that removes the initial displacement does not change the intended behavior of focusing and blurring needed for collapsing the fields. So run some tests with and without the patch and see if the behavior, with the exception of the initial displacement, has not been changed.
Comment #7
mstef commentedI really don't know what you're talking about...sorry
Comment #8
mstef commentedI see the latest release did not include this patch...
Everyone I know using editablefields uses this patch. Without it, this module really ruins the UI. Every page load, the pages automatically drop to the last input widget.
What's going to happen with it?
Comment #9
henrijs.seso commented+1 was about to post issue. thanks for patch!
Comment #10
rkeppner commentedI'd like to see this patch get committed or the lines removed, either way. What can I do to help the process along?
Comment #11
mstef commentedYea the patch just comments them out for now. I figured I'd let the maintainer decide what should be done with them.
Comment #12
rkeppner commentedI'm changing the category from feature request to bug report, since this seems like an actual problem with existing functionality, not a request to improve existing functionality. Please change it back if I'm wrong in this assumption.
My use case makes this "bug" rather egregious. I'm only using click to edit formatters, so the focus gets passed beyond the editable fields to the next form field on the page (which is actually half-way down the page from the editable fields), totally confusing users.
I'd really like to see this patch make it in. Or I could roll a new one that simply removes the lines in question, if that method is preferred.
What needs to be tested to ensure that this doesn't break things?
Comment #13
Anonymous (not verified) commentedPatch works for me.
I've set a date field (with popup) as editable. The focus was put on the date field and so a blinking cursor was shown there (which was annoying), but also prevented the popup appearing without first clicking off the field (blur), then back on again (focus).
Not using collapsible fields though...
Comment #14
aaronschachter commentedworks for me too!
Comment #15
peamik123 commentedIs there any likelyhood of this patch being released as a new version of editablefields please?
I've just hit the same problem, and the patch works for me also. But I am not confortable with the concept of live sites running for long periods with patched code, in case a later release comes along that doesn't include the patch.
Thanks
Comment #16
mstef commentedI can roll a new one if you want. This patch just comments out the code that causes this issue. It's probably best, if the maintainers agree to take this, to just completely remove it.
Comment #17
mry4n commentedI cloned branch 6.2.x: http://drupal.org/node/165016/git-instructions/6.x-2.x
I downloaded the patch and applied it, but I got this error msg:
Help me Obi Wan. You're my only hope.
Comment #18
mry4n commentedOK, I found the lines that needed to be commented out in editablefields.js, and just did so manually. Although, it's my understanding that the patch needs to apply properly in order to be committed. True?
Comment #19
mstef commentedI think at this point, we're all aware of what the issue is. Like you said, there's only three lines (or so) lines that shouldn't be there, so a patch isn't really needed. The patch I attached is old, and only comments them out rather than remove them. I can roll a new one, if needed.
Comment #20
mry4n commentedOK, this thing works! Thank you. Bringing the focus down to the bottom of the page was driving me batsh*t crazy.
Now... what's a guy gotta do to get a patch committed around here?
From what I see above it's been tested numerous times, and there's no reason the code that is commented out can't be taken out completely....?
Comment #21
mstef commented+1
I'm not sure why those lines were added in the first place. Seems a bit forthcoming to throw the user directly at a given field whenever a page is loaded.
Comment #22
mry4n commentedI assume that changing the status to "reviewed & tested by the community" is all we need to do at this point. Now we just wait for the maintainers to get through their backlog of patches. At least that's what I gather from here http://drupal.org/node/332678 .
If someone knows of something else we need to do, please post.
Comment #23
andreiashu commentedHi,
Thanks for testing and for the patch itself and sorry for such a late commit.
I've removed the lines where we were focusing and also gave credit to mikestefff.
Thanks,
Andrei
Comment #24
mstef commentedNice!
Thanks