datepickr icon indicating copy to clipboard operation
datepickr copied to clipboard

Support for tab key

Open jacobuid opened this issue 11 years ago • 7 comments

When the input is currently focused and the datepickr calendar is visible, and you press tab, the datepickr calendar stays open and another one opens showing 2 on the page.

Screenshot: image

jacobuid avatar Apr 07 '15 20:04 jacobuid

Here is the fix:

Create new var: image

Assign this function here: image

Add these eventListeners: image

jacobuid avatar Apr 07 '15 20:04 jacobuid

If you want to add me as a collaborator, ill create a branch and a pull request for you to merge

jacobuid avatar Apr 07 '15 20:04 jacobuid

Nice, good call on the issue... I don't agree with your fix though :smiling_imp: Easier and more performant fix would be to add a blur event if the element is an input... something similar to the getOpenEvent method:

bindCloseMethod = function () {
    if (self.element.nodeName === 'INPUT') {
        self.addEventListener(self.element, 'blur', close, false);
    }
}

I can probably look at this later tonight... Or if you want you can submit a pull request by forking my repo, creating the branch on your fork, then submitting the pr back to my repo.

No offense, but I would prefer not to add you as a collaborator, I just don't know you all that well :smile:

joshsalverda avatar Apr 07 '15 21:04 joshsalverda

Understood, i'm new to github, still finding my way around the site, i wasn't aware of the fork/pull request features. its all good! thanks for the added support!

jacobuid avatar Apr 08 '15 14:04 jacobuid

@joshsalverda did you test your fix, it has introduced some new issues, just wanted to give you a heads up. i'm going to just proceed with a variation of my fix for now. thanks for the tech support.

jacobuid avatar Apr 09 '15 15:04 jacobuid

I did some quick tests, didn't fully test all functionality (really need to refactor my code so I can write proper unit tests)... thanks for checking, what issues are you noticing?

joshsalverda avatar Apr 09 '15 15:04 joshsalverda

if you click the left(<) and right(>) calendar navigator buttons the datepickr calendar closes. that is the main thing i noticed, there may be other areas affected

jacobuid avatar Apr 09 '15 20:04 jacobuid