Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sizzle free #575

Closed
wants to merge 3 commits into from
Closed

Sizzle free #575

wants to merge 3 commits into from

Conversation

mmcgahan
Copy link
Contributor

:input is only available with jQuery builds that use Sizzle. Using an equivalent CSS selector string (input, select, textarea, button) makes pickadate compatible with more codebases.

This particular update only adds 1 character to lib/picker.js while simplifying an event target test in prepareElementRoot()

@amsul amsul added this to the 3.5.5 milestone Dec 2, 2014
@amsul amsul added the todo label Dec 2, 2014
@@ -666,7 +666,7 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
// prevent cases where focus is shifted onto external elements
// when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).
// Also, for Firefox, don’t prevent action on the `option` element.
if ( event.type == 'mousedown' && !$( target ).is( ':input' ) && target.nodeName != 'OPTION' ) {
if ( event.type == 'mousedown' && !$( target ).is( 'input, select, textarea, button, option' )) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmcgahan what about [contenteditable] or anything with a tabindex? We should probably add that in as well..?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[contenteditable] might be a good option, although it's a little edge-case and might introduce awkward bugs - I would conservatively keep the constraint on standard :input targets for now (jQuery just does a tagName regex match for its :input pseudo-selector).

tabindex is probably redundant if we're matching on all other input-y things?

@amsul
Copy link
Owner

amsul commented Dec 7, 2014

Merged into master: https://github.com/amsul/pickadate.js/ :)

Cheers!

@amsul amsul closed this Dec 7, 2014
@amsul amsul removed the todo label Dec 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants