Closed (fixed)
Project:
Nice Phone Numbers
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
22 Nov 2011 at 22:00 UTC
Updated:
16 Feb 2012 at 15:55 UTC
Jump to comment: Most recent file
When I load the edit tab for my node type, the last phone field on the page grabs focus. In my case, because the phone fields are so far down the page, this means my edit tab loads showing the middle of the form.
I expected that my edit tabs would open as normal, rather than scrolled halfway down.
I am working on a patch, but I'm not a JS wizard, so I'd love some help if you can give it. Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 0001-Add-fix-for-grabbing-focus-on-load-from-http-drupal..patch | 953 bytes | ezheidtmann |
| #3 | 0001-Fix-field-grabbing-focus-on-page-load.patch | 761 bytes | ezheidtmann |
| #1 | 0001-Prevent-field-from-grabbing-focus-on-page-load.patch | 1.06 KB | ezheidtmann |
Comments
Comment #1
ezheidtmann commentedThis patch solves the problem in Chromium, with no negative effect that I found.
It should be tested in other browsers.
Comment #2
ezheidtmann commentedPrevious patch breaks editing in the middle of the number in Firefox. Bummertown.
Comment #3
ezheidtmann commentedThis works in Firefox & Chromium. Testing in IE ...
Comment #4
ezheidtmann commentedThe latest patch solves the original issue in Firefox & Chromium, while maintaining all other editing features. In IE, it has no effect. Can you please review? Thanks!
Comment #5
NealB-1 commentedI have been swamped with work, and my development virtual machine crashed, so I can't test a fix. I looked at the repository through drupal.org, and I looked at your patch.
I think the problem is simply this. This is the code that executes on page load:
cursor should be getting set to null instead of zero, because zero is an actual cursor position, and triggers the conditional you were trying to fix:
I may have broken it when I refactored, but I'm glad I did. That javascript used to be a lot scarier to look at.
Comment #6
ezheidtmann commentedNice job, Neal. Tested successfully in Chrome, FF, and IE. Attached is the patch I'm using.
Comment #7
NealB-1 commentedThanks.