Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
date popup works fine If I reach to that particular textfield & click on that but when i reach there via 'Tabs' [using keyboard only] it won't popup as it is being focused only when click event is triggered in date_popup.js while simply registering focus() with popup class will do the job as focus will work in both cases whether it is keyboard or click event via mouse.
Replacing this [ in date_popup.js ]
$(this).click(function() {
$(this).focus();
});
With this
$(this).focus();
Attached is the patch which does the work.
Thanks
Comment | File | Size | Author |
---|---|---|---|
#11 | date_popup-initial-focus-1415210-11.patch | 1.32 KB | djdevin |
| |||
#7 | date_popup-initial-focus-1415210-7.patch | 1.17 KB | jgullstr |
#4 | date_popup.patch | 458 bytes | ohthehugemanatee |
date_popup_focus.patch | 508 bytes | nmudgal | |
Comments
Comment #2
JohnAlbinThe patch applies to 6.x-2.x-dev, not to 6.x-2.8 directly.
Comment #3
JohnAlbindate_popup_focus.patch queued for re-testing.
Comment #4
ohthehugemanatee CreditAttribution: ohthehugemanatee commentedHad the same issue on 7.x, so I rerolled the patch for 7.x .
Comment #5
Jelle_SNot sure if related, but if you start in a field above the date popup field and tab to the date popup field, the first time the popup will not trigger, as mentioned in the issue. But another issue is that when you tab again to go to the next field (time field next to the date popup field in my case), the focus is put somewhere else entirely (toolbar in my case). If you then click in your first field again and tab towards the date popup field, when you reach the date popup field, the popup will show. Tab again and you will reach the time field as you would have expected the first time through. From then on everything works as it should. It just doesn't seem to work the first time round.
PS: This was on 7.x
Comment #6
asirjacques CreditAttribution: asirjacques commentedI had the same issue but I solved it with this little trick into my Javascript file:
Cheers.
Comment #6.0
asirjacques CreditAttribution: asirjacques commentedadding filename
Comment #7
jgullstr CreditAttribution: jgullstr commentedThis is not resolved in 7.x-2.x.
Problem
First-time tabbing to a datepicker field does not open the calendar.
First-time tabbing to a timeEntry field prevents the user from tabbing further.
Reproduction
Create a date popup field, navigate to the field using TAB.
Reason
Drupal.behaviors.date_popup tries to lazy-load the datepicker instances. Instead of triggering a focus event when the plug-in is loaded, makeFocusHandler binds to the click event. The click event will fire after focus when if the field is clicked the first time, but if tabbed to, the plugin wont run before tabbed to a second time.
Solution
Either remove the lazy-loading entirely (initialize date pickers in the behavior), or trigger a focus event after initializing the plugin on the field (same approach as in earlier posts). Patch for triggering focus attached.
(Also, unbinding makeFocusHandler after its first call should be more effective than checking for the date-popup-init class on subsequent focus events.)
Comment #9
christine1126 CreditAttribution: christine1126 commented@Jelle_S (#5) I had similar issue with tabbing order on date/time. Go to 'Date popup' under configuration > Change Timepicker from 'Use default jQuery timepicker' to 'Manual time entry, no jQuery timepicker'. Then tab order works ok.
Comment #10
cydharttha CreditAttribution: cydharttha commentedPatch from #7 works great so far here. Thanks!
Comment #11
djdevinConfirmed this is still happening.
Re-rolled for 7.x-2.x
Comment #12
steinmb CreditAttribution: steinmb as a volunteer commentedConfirm the patch addresses the issue. Normal tabbing forward and backwards now works.
Comment #15
DamienMcKennaCommitted. Thanks.